diff --git a/yuthon_hr_attendance/models/yuthon_duty_plan.py b/yuthon_hr_attendance/models/yuthon_duty_plan.py index 09bfb0a3b..1edff95a6 100644 --- a/yuthon_hr_attendance/models/yuthon_duty_plan.py +++ b/yuthon_hr_attendance/models/yuthon_duty_plan.py @@ -17,6 +17,15 @@ class YuthonDutyPlan(models.Model): white_line_ids = fields.One2many('white.plan.line', 'duty_plan_id', string='关联常白班') notice = fields.Text(string='计划说明') zu = fields.Integer(string='值班组') + scheduled_month = fields.Integer(string='已排到月份', compute='_compute_scheduled_month', store=True) + + @api.depends('plan_line_ids') + def _compute_scheduled_month(self): + for rec in self: + last_slot = self.env['planning.slot'].search( + [('role_id.name', '=', '联安粮库')], + order='start_datetime desc', limit=1) + rec.scheduled_month = last_slot.start_datetime.month if last_slot else 0 @api.onchange('plan_line_ids', 'white_line_ids') def _onchange_sync_lianan_role_employees(self): diff --git a/yuthon_hr_attendance/views/yuthon_duty_plan_views.xml b/yuthon_hr_attendance/views/yuthon_duty_plan_views.xml index fe63cef00..0a86488e0 100644 --- a/yuthon_hr_attendance/views/yuthon_duty_plan_views.xml +++ b/yuthon_hr_attendance/views/yuthon_duty_plan_views.xml @@ -36,6 +36,7 @@ + diff --git a/yuthon_issue/wizard/soong_workflow_comment_wizard_inherit.xml b/yuthon_issue/wizard/soong_workflow_comment_wizard_inherit.xml index 351861c4a..798cf8564 100644 --- a/yuthon_issue/wizard/soong_workflow_comment_wizard_inherit.xml +++ b/yuthon_issue/wizard/soong_workflow_comment_wizard_inherit.xml @@ -15,15 +15,19 @@ invisible="not is_avoid" options="{'no_create': True}" domain="[('id', 'in', issue_filter_ids)]"/> + - + + +