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')))