From d3ddf7b679dbce47bc3368897de601c8e714f439 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 16:29:00 +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 --- .../views/soong_workflow_record.xml | 2 +- .../models/yuthon_file_processing.py | 26 ++++++++++++++++--- .../models/yuthon_sub_enterprises.py | 6 +++++ .../views/yuthon_file_processing_views.xml | 4 ++- .../views/yuthon_sub_enterprises_view.xml | 8 +++--- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index 50eafb297..81aa6eea3 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -425,7 +425,7 @@ 'check_employee': 1} [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', 'in', - ['done', 'active']), ('is_company', '=', True)] + ['done', 'active'])] diff --git a/yuthon_official/models/yuthon_file_processing.py b/yuthon_official/models/yuthon_file_processing.py index 5beca599c..6339d6dd6 100644 --- a/yuthon_official/models/yuthon_file_processing.py +++ b/yuthon_official/models/yuthon_file_processing.py @@ -35,7 +35,6 @@ class YuthonFileProcessing(models.Model): string="抄送单位" ) department_ids = fields.Many2many('hr.department', string='部门范围') - employee_ids = fields.Many2many('hr.employee', string='人员范围') users_role_ids = fields.Many2many('soong.user.role', string='角色范围') servings_number = fields.Integer(string="份数") @@ -65,7 +64,7 @@ class YuthonFileProcessing(models.Model): red_suit = fields.Char(string="套红") official_documents_ids = fields.Many2many('ir.attachment', string="附件") - + completion_time = fields.Datetime(string="办结时间") is_supervising = fields.Boolean(string="是否督办") deadline = fields.Datetime(string="办理期限") done_date = fields.Date(string="完成时间") @@ -74,6 +73,18 @@ class YuthonFileProcessing(models.Model): issue_library_ids = fields.One2many('issue.library', 'yuthon_official_id', string="议题关联") work_end = fields.Boolean(string="结束") official_state = fields.Selection([('to_do', '待转'), ('done', '已转')], string="状态") + employee_ids1 = fields.Many2many( + 'hr.employee', + 'yuthon_file_processing_employee1_rel', + 'file_id', 'employee_id', + string="经办人" + ) + employee_ids = fields.Many2many( + 'hr.employee', + 'yuthon_file_processing_employee_rel', + 'file_id', 'employee_id', + string='人员范围' + ) def _get_default_name_title(self): return self._description if self._description else self._name @@ -88,7 +99,7 @@ class YuthonFileProcessing(models.Model): default=lambda self: [(6, 0, [self.env.user.id])] ) users_ids = fields.Many2many('res.users', - string="当前经办人", + string="用户", relation='yuthon_file_processing_users_rel', column1='processing_id', column2='compute_user_id', @@ -144,15 +155,22 @@ class YuthonFileProcessing(models.Model): record.users_ids = False record.approve_state = False record.soong_state = False + record.employee_id = 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_ids1 = workflow.employee_id.ids + record.users_ids = workflow.users_ids.ids record.approve_state = workflow.approve_state record.soong_state = workflow.soong_state + if record.log_ids: + record.completion_time = record.log_ids[-1].lase_click_date + else: + record.completion_time = False + @api.onchange('is_cold') def onchange_is_cold(self): if self.is_cold: diff --git a/yuthon_official/models/yuthon_sub_enterprises.py b/yuthon_official/models/yuthon_sub_enterprises.py index 9fa4dc188..5dcc2e985 100644 --- a/yuthon_official/models/yuthon_sub_enterprises.py +++ b/yuthon_official/models/yuthon_sub_enterprises.py @@ -29,6 +29,7 @@ class YuthonSubEnterprises(models.Model): default='normal') work_end = fields.Boolean(string="结束") employee_ids = fields.Many2many('hr.employee', string="经办人") + completion_time = fields.Datetime(string="办结时间") def _get_default_name_title(self): return self._description if self._description else self._name @@ -103,6 +104,11 @@ class YuthonSubEnterprises(models.Model): record.approve_state = workflow.approve_state record.soong_state = workflow.soong_state + if record.log_ids: + record.completion_time = record.log_ids[-1].lase_click_date + else: + record.completion_time = False + def compute_workflow(self): enterprises_ids = self.env["yuthon.sub.enterprises"].browse( self._context.get('active_ids', self._context.get('active_id'))) diff --git a/yuthon_official/views/yuthon_file_processing_views.xml b/yuthon_official/views/yuthon_file_processing_views.xml index 21208adef..d10e967eb 100644 --- a/yuthon_official/views/yuthon_file_processing_views.xml +++ b/yuthon_official/views/yuthon_file_processing_views.xml @@ -8,7 +8,9 @@ - + + + diff --git a/yuthon_official/views/yuthon_sub_enterprises_view.xml b/yuthon_official/views/yuthon_sub_enterprises_view.xml index 0ba13b63e..f4f883076 100644 --- a/yuthon_official/views/yuthon_sub_enterprises_view.xml +++ b/yuthon_official/views/yuthon_sub_enterprises_view.xml @@ -7,10 +7,12 @@ - + - - + + +