From 1f547da229c961f67f01d0978125b8e298dc9a0f 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, 22 Sep 2025 18:14:56 +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 --- soong_workflow/models/soong_workflow_mixin.py | 6 +++++- soong_workflow/wizard/soong_workflow_comment_wizard.py | 2 +- yuthon_property/models/yuthon_property.py | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index b6a97fc76..2c73dce71 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -394,6 +394,10 @@ class SoongWorkflowMixin(models.AbstractModel): if self._module in ['yuthon_official']: is_supervising = self.is_supervising is_first_node = (self_state == 0) + if is_first_node: + comment_note_id = self.env['soong.note'].search([('name', '=', '妥否,呈领导审批。')], limit=1).id + else: + comment_note_id = False return { "name": _("评论"), "type": "ir.actions.act_window", @@ -404,7 +408,7 @@ class SoongWorkflowMixin(models.AbstractModel): "target": "new", "context": { "default_res_id": self.id, - 'default_comment_note': "妥否,呈领导审批" if is_first_node else "", + 'default_comment_note_id': comment_note_id, "default_code": self.code, "default_res_model": self._name, "default_log_ids": logs.ids, diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index d34ec9359..0174882ee 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -23,7 +23,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): user_role_ids = fields.Many2many('soong.user.role', string="角色", compute='_compute_user_role_ids', store=True) node_link_len = fields.Char(string="转交2") is_supervising = fields.Boolean(string="是否督办") - comment_note_id = fields.Many2one('soong.note', string="常用意见", default='妥否,呈领导审批') + comment_note_id = fields.Many2one('soong.note', string="常用意见") comment_note = fields.Char(string="意见") comment = fields.Char(compute='_compute_comment', store=True) state_list = fields.Char(string="状态列表") diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index d7b20ab3a..2fa88675e 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -286,6 +286,7 @@ class YuthonProperty(models.Model): 'default_property_id': self.id } } + def put_property_handover(self): property_ids = self.env["yuthon.property"].browse( self._context.get('active_ids', self._context.get('active_id')))