diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index a9156889a..e2192b746 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -87,7 +87,6 @@ class SoongWorkflowMixin(models.AbstractModel): def _compute_is_back(self): for record in self: - record.is_back = False current_state = record.state if not current_state or not record.log_ids: continue @@ -105,6 +104,8 @@ class SoongWorkflowMixin(models.AbstractModel): ) if has_handling_log or has_handling_log2: record.is_back = False + else: + record.is_back = True def _compute_is_confirm(self): for record in self: @@ -119,9 +120,6 @@ class SoongWorkflowMixin(models.AbstractModel): if lg1: record.is_end = False - - - @api.depends("node_id", "log_ids") def _compute_approval_sign_ids(self): for record in self: @@ -775,21 +773,21 @@ class SoongWorkflowMixin(models.AbstractModel): wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) for node in wkf_rec.node_ids: for button in node.button_ids: - if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): - btn_exec_action_el = etree.SubElement(header_el, "button") - btn_exec_action_el.set("name", "btn_exec_action") - btn_exec_action_el.set("string", button.name) - btn_exec_action_el.set("type", "object") - if button.is_highlight: - btn_exec_action_el.set("class", "oe_highlight") - if button.has_icon: - btn_exec_action_el.set("icon", button.icon) - invisible_condition = "state != '%s'" % node.node_name - if model == 'purchase.order': - invisible_condition = invisible_condition.replace("询价", "draft") - btn_exec_action_el.set("invisible", invisible_condition) - btn_exec_action_el.set("context","{'btn_key':'%s','active_model':'%s'}" % (button.btn_key, self._name), ) - else: + # if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): + # btn_exec_action_el = etree.SubElement(header_el, "button") + # btn_exec_action_el.set("name", "btn_exec_action") + # btn_exec_action_el.set("string", button.name) + # btn_exec_action_el.set("type", "object") + # if button.is_highlight: + # btn_exec_action_el.set("class", "oe_highlight") + # if button.has_icon: + # btn_exec_action_el.set("icon", button.icon) + # invisible_condition = "state != '%s'" % node.node_name + # if model == 'purchase.order': + # invisible_condition = invisible_condition.replace("询价", "draft") + # btn_exec_action_el.set("invisible", invisible_condition) + # btn_exec_action_el.set("context","{'btn_key':'%s','active_model':'%s'}" % (button.btn_key, self._name), ) + # else: is_apostille = False if button.btn_hide: if button.review_type == "individual": diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 4b751d955..6494a41bf 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -327,15 +327,15 @@ class SoongWorkflowCommentWizard(models.TransientModel): return self.env['hr.employee'] # 默认返回空记录集 def add_comment(self): - has_comment_note = bool(self.comment_note_id) - has_comment = bool(self.comment and self.comment.strip()) - if not has_comment_note and not has_comment: - raise UserError('请填写备注') self.ensure_one() cx = self.env.context.copy() or {} record_id = self.env[self.res_model].search([('id', '=', self.res_id)]) is_admin = self.env.user.has_group('soong_workflow.group_soong_workflow_manager') if self.node_btn_name == '转交': + has_comment_note = bool(self.comment_note_id) + has_comment = bool(self.comment and self.comment.strip()) + if not has_comment_note and not has_comment: + raise UserError('请填写备注') self_node_id = record_id.workflow_id.node_ids.search( [('name', '=', record_id.state), ('workflow_id', '=', record_id.workflow_id.id)]) log = self.env['soong.workflow.log'].search([("model", "=", self.res_model), diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml b/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml index 0a3a3eee8..9576025f7 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml +++ b/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml @@ -91,7 +91,7 @@ - +