@@ -160,6 +160,16 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
for record in self:
|
||||
record.is_confirm = False
|
||||
record.is_end = False
|
||||
target_models = ['yuthon.official.incoming.normal', 'yuthon.sub.enterprises']
|
||||
if record._name in target_models:
|
||||
chairman_logs = record.log_ids.filtered(
|
||||
lambda log: '董事长' in (log.name or '')
|
||||
and log.approval_state in ['0', '1']
|
||||
)
|
||||
if chairman_logs:
|
||||
record.is_end = True
|
||||
continue
|
||||
|
||||
log_ids_domain = [
|
||||
('done_by', '=', self.env.user.id),
|
||||
('workflow_id', '=', record.workflow_id.id),
|
||||
|
||||
@@ -793,7 +793,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
})
|
||||
else:
|
||||
if workflow_record:
|
||||
workflow_record.write({
|
||||
workflow_record.sudo().write({
|
||||
'approve_state': 'end',
|
||||
'employee_ids': False,
|
||||
'node_id': False,
|
||||
|
||||
Reference in New Issue
Block a user