@@ -128,17 +128,10 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
|
||||
def _compute_is_active(self):
|
||||
current_user_id = self.env.user.id
|
||||
self.is_active = False
|
||||
if self.log_ids:
|
||||
if self.log_ids[0].done_by.id == current_user_id and self.log_ids[-1].approval_state in ['0', '1']:
|
||||
if self.log_ids[-1].name == '归档' and self.log_ids[-1].done_by.id == current_user_id and self.log_ids[-1].approval_state in ['0', '1']:
|
||||
self.is_active = True
|
||||
else:
|
||||
self.is_active = False
|
||||
else:
|
||||
self.is_active = False
|
||||
|
||||
# if self.log_ids:
|
||||
# if self.log_ids[-1].name == '归档' and self.log_ids[-1].is_active_operate == True:
|
||||
# self.is_active = False
|
||||
|
||||
def _compute_is_done(self):
|
||||
for record in self:
|
||||
|
||||
@@ -473,6 +473,16 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
'document_ids': [(6, 0, self.document_ids.ids)],
|
||||
"lase_click_date": fields.Datetime.now()
|
||||
})
|
||||
if current_node_log.node_btn_name == '3':
|
||||
other_node_logs = self.sudo().env["soong.workflow.log"].search(
|
||||
[("model", "=", self.res_model),
|
||||
("res_id", "=", self.res_id),
|
||||
("id", "!=", current_node_log.id),
|
||||
("node_id", "=", self.node_btn_id.node_id.id)
|
||||
])
|
||||
for other_node_log in other_node_logs:
|
||||
other_node_log.unlink()
|
||||
|
||||
# 检查是否为并审模式
|
||||
if self.approval_concatenation == 'bing': # 并审模式考勤异常
|
||||
# 获取当前节点应该审批的所有员工
|
||||
@@ -683,6 +693,16 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
'lase_click_date': current_datetime,
|
||||
'document_ids': [(6, 0, self.document_ids.ids)]
|
||||
})
|
||||
if user_log.node_btn_name == '3':
|
||||
other_node_logs = self.sudo().env["soong.workflow.log"].search(
|
||||
[("model", "=", self.res_model),
|
||||
("res_id", "=", self.res_id),
|
||||
("id", "!=", user_log.id),
|
||||
("node_id", "=", self.node_btn_id.node_id.id)
|
||||
])
|
||||
for other_node_log in other_node_logs:
|
||||
other_node_log.unlink()
|
||||
|
||||
if (record_id.log_ids2 or record_id.log_ids.filtered(lambda log: log.name == '承办')) and self.node_btn_name == '确认':
|
||||
user_log2 = record_id.log_ids2.filtered(lambda log: log.done_by == current_user)
|
||||
user_log1 = record_id.log_ids.filtered(lambda log: log.done_by == current_user)
|
||||
|
||||
Reference in New Issue
Block a user