diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 8787ac26d..3ad12a9af 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -28,6 +28,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): is_supervising = fields.Boolean(string="是否督办") comment_note_id = fields.Many2one('soong.note', string="常用意见") comment_note = fields.Text(string="意见") + illustrate = fields.Text(string="说明") comment = fields.Char(compute='_compute_comment', store=True) state_list = fields.Char(string="状态列表") record_id = fields.Integer() @@ -223,10 +224,16 @@ class SoongWorkflowCommentWizard(models.TransientModel): button = False if node.button_ids: for btn_name in button_priority_list: - target_btn = next((btn for btn in node.button_ids if btn.name == btn_name), None) - if target_btn: - button = target_btn - break + for btn in node.button_ids: + if btn.name == btn_name: + expression_result = False + if btn.is_review_invisible: + domain = eval(btn.invisible_expression) + expression_result = record_id.search(domain + [('id', '=', record_id.id)]) + if expression_result: + target_btn = btn + button = target_btn + break if not button: return self.env['hr.employee'] diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py index dbdea47bb..23026d5c8 100644 --- a/yuthon_issue/models/issue_library.py +++ b/yuthon_issue/models/issue_library.py @@ -464,15 +464,21 @@ class IssueLibrary(models.Model): current_user = self.env.user user_company_name = current_user.company_id.name if current_user.company_id else "" for ras in issue_active_ids: - if ras.is_push_boss: + if ras.is_push_boss and not ras.boss_char: if ras.issue_state_boss != 'will': raise UserError('当前状态不允许上会') - elif ras.is_push_class: + else: + break + elif ras.is_push_class and not ras.class_char: if ras.issue_state_class != 'will': raise UserError('当前状态不允许上会') - elif ras.is_push_party: + else: + break + elif ras.is_push_party and not ras.party_char: if ras.issue_state_party != 'will': raise UserError('当前状态不允许上会') + else: + break issue_details = [] target_meeting_type_id = False