添加功能
This commit is contained in:
@@ -123,7 +123,7 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
def _compute_is_active(self):
|
||||
current_user_id = self.env.user.id
|
||||
if self.log_ids:
|
||||
if self.log_ids[0].done_by.id == current_user_id and self.work_end and self.log_ids[-1].approval_state in ['0', '1']:
|
||||
if self.log_ids[0].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
|
||||
@@ -537,20 +537,30 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
|
||||
#根据实际路径创建trans.link记录并生成domain
|
||||
actual_path_links = []
|
||||
sequence = None
|
||||
for node in actual_path_nodes[1:]:
|
||||
for out_link in node.out_link_ids:
|
||||
if node.id == out_link.node_to.id:
|
||||
sequence = out_link.node_to.sequence
|
||||
if node.name not in skipped_node_names:
|
||||
link = self.env['trans.link'].create({
|
||||
'node_button_id': btn_rec.id,
|
||||
'name': node.name,
|
||||
'sequence': sequence,
|
||||
'link_type': 'trans',
|
||||
'record_id': self.id,
|
||||
})
|
||||
actual_path_links.append(link)
|
||||
|
||||
for node in actual_path_nodes[1:]:
|
||||
if node.name not in skipped_node_names:
|
||||
for out_link in node.out_link_ids:
|
||||
target_node = out_link.node_to
|
||||
if not target_node:
|
||||
continue
|
||||
link = self.env['trans.link'].create({
|
||||
'node_button_id': btn_rec.id,
|
||||
'name': node.name,
|
||||
'sequence': out_link.sequence,
|
||||
'link_type': 'trans',
|
||||
'record_id': self.id,
|
||||
})
|
||||
actual_path_links.append(link)
|
||||
link = self.env['trans.link'].create({
|
||||
'node_button_id': btn_rec.id,
|
||||
'name': node.name,
|
||||
'link_type': 'trans',
|
||||
'record_id': self.id,
|
||||
})
|
||||
actual_path_links.append(link)
|
||||
|
||||
if actual_path_links:
|
||||
trans_link_ids = [link.id for link in actual_path_links]
|
||||
|
||||
Reference in New Issue
Block a user