From a0b462b793a73069968a5bec5cb58c435a8dc41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Mon, 26 Jan 2026 15:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_official/models/yuthon_sub_enterprises.py | 8 ++++++-- yuthon_official/views/yuthon_sub_enterprises_view.xml | 3 ++- yuthon_salary/views/yuthon_salary_active_views.xml | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/yuthon_official/models/yuthon_sub_enterprises.py b/yuthon_official/models/yuthon_sub_enterprises.py index 7aa8c3f45..9fa4dc188 100644 --- a/yuthon_official/models/yuthon_sub_enterprises.py +++ b/yuthon_official/models/yuthon_sub_enterprises.py @@ -28,6 +28,8 @@ class YuthonSubEnterprises(models.Model): urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', default='normal') work_end = fields.Boolean(string="结束") + employee_ids = fields.Many2many('hr.employee', string="经办人") + def _get_default_name_title(self): return self._description if self._description else self._name @@ -41,7 +43,7 @@ class YuthonSubEnterprises(models.Model): default=lambda self: [(6, 0, [self.env.user.id])] ) users_ids = fields.Many2many('res.users', - string="当前经办人", + string="用户", relation='yuthon_sub_enterprises_users_rel', column1='enterprise_id', column2='compute_user_id', @@ -90,12 +92,14 @@ class YuthonSubEnterprises(models.Model): record.users_ids = False record.approve_state = False record.soong_state = False + record.employee_ids = False workflow = self.env['soong.workflow.record'].sudo().search( [('code', '=', record.code)], limit=1 ) if workflow: - record.users_ids = workflow.employee_ids.mapped('user_id') + record.employee_ids = workflow.employee_ids.ids + record.users_ids = workflow.users_ids.ids record.approve_state = workflow.approve_state record.soong_state = workflow.soong_state diff --git a/yuthon_official/views/yuthon_sub_enterprises_view.xml b/yuthon_official/views/yuthon_sub_enterprises_view.xml index 78b368e54..0ba13b63e 100644 --- a/yuthon_official/views/yuthon_sub_enterprises_view.xml +++ b/yuthon_official/views/yuthon_sub_enterprises_view.xml @@ -8,7 +8,8 @@ - + + diff --git a/yuthon_salary/views/yuthon_salary_active_views.xml b/yuthon_salary/views/yuthon_salary_active_views.xml index fe3ea4f25..5cc4b4828 100644 --- a/yuthon_salary/views/yuthon_salary_active_views.xml +++ b/yuthon_salary/views/yuthon_salary_active_views.xml @@ -4,7 +4,7 @@ yuthon.salary.active.tree yuthon.salary.active - +