Merge pull request !9600 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-03-11 10:43:40 +00:00
committed by Gitee
3 changed files with 27 additions and 1 deletions
+13 -1
View File
@@ -87,7 +87,19 @@ class SoongWorkflow(models.Model):
note_text_to_rec[opinion_text] = note_rec
node.write({field_name: note_rec.id})
def update_confirm(self):
soong_ids = self.env["soong.workflow"].browse(
self._context.get('active_ids', self._context.get('active_id'))
)
for node in soong_ids.node_ids:
confirm_buttons = node.button_ids.filtered(lambda btn: btn.name == '确认')
if not confirm_buttons:
self.env['soong.workflow.node.button'].create({
'node_id': node.id,
'name': '确认',
'action_type': 'code',
"has_comment": True
})
def change_opinions_wizard(self):
soong_ids = self.env["soong.workflow"].browse(
@@ -260,8 +260,15 @@ class SoongWorkflowNode(models.Model):
"workflow_id": record.workflow_id.id,
"sequence": 2,
"action_type": "code",
"has_comment": True}),
(0, 0, {
"name": _("确认"),
"workflow_id": record.workflow_id.id,
"sequence": 2,
"action_type": "code",
"has_comment": True})
]})
# 运行时执行加载所有form,并且只读
model_id = self.env['soong.workflow'].search([('id', '=', record.workflow_id.id), ('is_enable', '=', True)]).model_id
form_view = self.env["ir.ui.view"].search([("model", "=", model_id.model), ("type", "=", "form")], limit=1)
@@ -122,4 +122,11 @@
<field name="state">code</field>
<field name="code">action = model.change_opinions_wizard()</field>
</record>
<record id="update_confirm" model="ir.actions.server">
<field name="name">一次性</field>
<field name="model_id" ref="soong_workflow.model_soong_workflow"/>
<field name="binding_model_id" ref="soong_workflow.model_soong_workflow"/>
<field name="state">code</field>
<field name="code">action = model.update_confirm()</field>
</record>
</odoo>