oca-ocb-hr/odoo-bringout-oca-ocb-hr_maintenance/hr_maintenance/wizard/hr_departure_wizard.py
Ernad Husremovic e1d89e11e3 19.0 vanilla
2026-03-09 09:31:00 +01:00

15 lines
546 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import Command, fields, models
class HrDepartureWizard(models.TransientModel):
_inherit = 'hr.departure.wizard'
unassign_equipment = fields.Boolean("Free Equiments", default=True, help="Unassign Employee from Equipments")
def action_register_departure(self):
action = super().action_register_departure()
if self.unassign_equipment:
self.employee_ids.write({'equipment_ids': [Command.clear()]})
return action