!2639 添加功能

Merge pull request !2639 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-05-03 12:18:03 +00:00
committed by Gitee
2 changed files with 17 additions and 10 deletions
@@ -24,7 +24,8 @@ class SoongWorkflowCommentWizard(models.TransientModel):
node_link_len = fields.Char(string="转交2")
is_supervising = fields.Boolean(string="是否督办")
comment_note_id = fields.Many2one('soong.note', string="常用意见", default='妥否,呈领导审批')
comment_note = fields.Char(string="意见", index=True, store=True)
comment_note = fields.Char(string="意见")
comment = fields.Char(compute='_compute_comment', store=True)
state_list = fields.Char(string="状态列表")
record_id = fields.Integer()
trans_link_id = fields.Many2one('trans.link', string='转交节点')
@@ -43,10 +44,15 @@ class SoongWorkflowCommentWizard(models.TransientModel):
string="督办人员", store=True)
is_automatic = fields.Boolean('是否自动匹配')
@api.onchange('comment_note_id')
def _onchange_comment_note_id(self):
if self.comment_note_id:
self.comment_note = self.comment_note_id.name
@api.depends('comment_note_id', 'comment_note')
def _compute_comment(self):
for record in self:
comment_parts = []
if record.comment_note_id:
comment_parts.append(record.comment_note_id.name)
if record.comment_note:
comment_parts.append(record.comment_note)
record.comment = " ".join(comment_parts) if comment_parts else ""
@api.depends('user_id.employee_ids.user_role_ids')
def _compute_user_role_ids(self):
@@ -146,10 +152,10 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"node_btn_id": self.node_btn_id.id,
"lase_click_date": fields.Datetime.now(),
"approval_state": "2",
"comment": self.comment_note,
"comment": self.comment,
})
else:
now_record_obj.write({"comment": self.comment_note,
now_record_obj.write({"comment": self.comment,
"approval_state": "2",
"lase_click_date": fields.Datetime.now()})
next_node_id = record_id.workflow_id.node_ids.search([('name', 'ilike', self.trans_link_id.name),
@@ -210,7 +216,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
next_node_id = next_link.node_from
record_id.log_ids[-1].write({'approval_state': '2',
"lase_click_date": fields.Datetime.now(),
"comment": self.comment_note,
"comment": self.comment,
"node_btn_name": "1"})
# if not self.sudo().env["soong.workflow.log"].search([('node_id', '=', next_node_id.id)]):
self.sudo().env["soong.workflow.log"].create({
@@ -227,7 +233,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
workflow_record_id.employee_ids = self.employee_ids
return self.node_btn_id.with_context(cx).run()
if self.node_btn_name == '结束':
record_id.log_ids[-1].comment = self.comment_note
record_id.log_ids[-1].comment = self.comment
record_id.log_ids[-1].approval_state = "3"
record_id.log_ids[-1].lase_click_date = fields.Datetime.now()
record_id.work_end = True
@@ -236,7 +242,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"node_id": False,})
if self.node_btn_name == "分发":
if self.employee_ids:
record_id.log_ids[-1].write({"comment": self.comment_note,
record_id.log_ids[-1].write({"comment": self.comment,
"approval_state": "2",
"lase_click_date": fields.Datetime.now()})
self.sudo().env["soong.workflow.log"].create({
@@ -16,6 +16,7 @@
<field name="comment_note" placeholder="请输入意见内容..." style="width: 100%;"/>
</div>
</group>
<field name="comment"/>
<group invisible="node_btn_name != '结束'">
<div class="oe_comment_block" style=" width:1200%; border: 1px solid #dee2e6; border-radius: 4px; padding: 12px; margin-bottom: 16px;">
<label for="comment_note_id" string="结束意见" domain="[('note_setting_id.users_role_ids', 'in', user_role_id)]"