diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py index 4db721d1c..2e328971a 100644 --- a/soong_workflow/models/soong_workflow_node.py +++ b/soong_workflow/models/soong_workflow_node.py @@ -88,7 +88,7 @@ class SoongWorkflowNode(models.Model): is_carbon_copy = fields.Boolean(string="抄送/传阅") is_apostille = fields.Boolean(string="加签", default=False) employee_ids = fields.Many2many('hr.employee', string='抄送/传阅人员') - is_end = fields.Boolean(string="结束") + is_end = fields.Boolean(string="结束", default=False) @api.onchange("is_apostille") def onchange_is_apostille(self): @@ -116,7 +116,8 @@ class SoongWorkflowNode(models.Model): }) ] else: - record.button_ids.filtered(lambda r: r.name in ["加签", "加签确认"]).unlink() + remove_ids = record.button_ids.filtered(lambda r: r.name in ["加签", "加签确认"]) + record.button_ids = [(3, remove_id.id) for remove_id in remove_ids] @api.onchange("is_end") def onchange_is_end(self): @@ -137,7 +138,8 @@ class SoongWorkflowNode(models.Model): ] else: record.res_bg_color = DEFAULT_BG_COLOR - record.button_ids.filtered(lambda r: r.name in ["结束"]).unlink() + remove_ids = record.button_ids.filtered(lambda r: r.name in ["结束"]) + record.button_ids = [(3, remove_id.id) for remove_id in remove_ids] @api.model_create_multi