diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index c764d5164..e81698484 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -59,3 +59,8 @@ class HrContract(models.Model): "target": "new", } + def refresh_contract_action(self): + resource_calendar_id = self.env['resource.calendar'].search([('name', '=', '行政考勤')], limit=1) + for rec in self: + rec.write({ + 'resource_calendar_id': resource_calendar_id.id,}) diff --git a/yuthon_contract/views/inherit_hr_contract_views.xml b/yuthon_contract/views/inherit_hr_contract_views.xml index 87718dbdc..fc1d4a6f8 100644 --- a/yuthon_contract/views/inherit_hr_contract_views.xml +++ b/yuthon_contract/views/inherit_hr_contract_views.xml @@ -81,4 +81,11 @@ code action = model.action_hr_contract() + + 刷新部门 + + + code + action = model.refresh_contract_action() +