From 28ef72185e6e24d8981f70b3a4021c4c9aa41b60 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: Tue, 20 Jan 2026 15:37:34 +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_issue/models/issue_library.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py index a435288a0..aa5e191b7 100644 --- a/yuthon_issue/models/issue_library.py +++ b/yuthon_issue/models/issue_library.py @@ -75,6 +75,8 @@ class IssueLibrary(models.Model): is_push_boss = fields.Boolean(string="董事推送") is_push_depart = fields.Boolean(string="部门推送") + is_state_updated = fields.Boolean(string='状态是否已更新', default=False) + def issue_party_approval(self): issue_active_ids = self.env["issue.library"].browse( self._context.get('active_ids', self._context.get('active_id')) @@ -254,6 +256,9 @@ class IssueLibrary(models.Model): def library_push(self): for rec in self: + if rec.is_state_updated: + continue + push_update_vals = {} if rec.is_party and (rec.is_party_passed == 'reject' or not rec.is_party_passed): push_update_vals['is_push_party'] = True @@ -266,9 +271,16 @@ class IssueLibrary(models.Model): if push_update_vals: rec.write(push_update_vals) - rec.write({ - 'issue_state': 'to_approval' - }) + if not rec.is_state_updated: + rec.write({ + 'issue_state': 'to_approval', + 'is_state_updated': True + }) + else: + rec.write({ + 'issue_state': 'will'} + ) + @api.onchange('is_legal_trial') def _onchange_is_legal_trial(self):