添加功能
This commit is contained in:
@@ -279,7 +279,8 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
self.env['trans.link'].search([]).unlink()
|
||||
# 退回节点根据日志进行判断
|
||||
if btn_rec.name == '退回':
|
||||
for ret in self.log_ids.search([('approval_state', '=', '2'), ('res_id', '=', self.id), ('node_btn_name', '=', '0')]):
|
||||
approved_logs = self.log_ids.filtered(lambda log: log.approval_state == '2')
|
||||
for ret in approved_logs:
|
||||
if not self.env['trans.link'].search([('name', '=', ret.name)]):
|
||||
self.env['trans.link'].create({
|
||||
'node_button_id': btn_rec.id,
|
||||
@@ -422,8 +423,7 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
"default_trans_link_id": self.env['trans.link'].search(trans_domain, limit=1).id if btn_rec.name == '转交' else False,
|
||||
"all_workflow_links": trans_link_ids,
|
||||
"default_return_link_id": self.env['trans.link'].search(
|
||||
[('record_id', '=', self.id)],
|
||||
limit=1).id if btn_rec.name == '退回' else False,
|
||||
[('link_type', '=', 'return'), ('record_id', '=', self.id)], limit=1).id if btn_rec.name == '退回' else False,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user