!8148 添加功能

Merge pull request !8148 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2026-01-20 07:12:14 +00:00
committed by Gitee
@@ -110,15 +110,15 @@ class SoongWorkflowMixin(models.AbstractModel):
next_log = all_sorted_logs[current_log_index + 1]
if next_log.approval_state == "0":
record.is_back = True
if record._name in ['yuthon.official.incoming.normal', 'yuthon.sub.enterprises']:
current_user_in_logs2 = any(log.done_by.id == self.env.uid for log in record.log_ids2)
organizer_user_in_logs = any(log.done_by.id == self.env.user.id for log in record.log_ids.filtered(lambda l: l.name == '承办'))
all_handling_logs_approval_0 = all(log.approval_state == '0' for log in record.log_ids.filtered(lambda l: l.name == '承办'))
all_logs2_approval_0 = all(log.approval_state == '0' for log in record.log_ids2)
if all_logs2_approval_0 and all_handling_logs_approval_0 and not current_user_in_logs2 and not organizer_user_in_logs:
record.is_back = True
else:
record.is_back = False
if record._name in ['yuthon.official.incoming.normal', 'yuthon.sub.enterprises']:
current_user_in_logs2 = any(log.done_by.id == self.env.uid for log in record.log_ids2)
organizer_user_in_logs = any(log.done_by.id == self.env.user.id for log in record.log_ids.filtered(lambda l: l.name == '承办'))
all_handling_logs_approval_0 = all(log.approval_state == '0' for log in record.log_ids.filtered(lambda l: l.name == '承办'))
all_logs2_approval_0 = all(log.approval_state == '0' for log in record.log_ids2)
if all_logs2_approval_0 and all_handling_logs_approval_0 and not current_user_in_logs2 and not organizer_user_in_logs:
record.is_back = True
else:
record.is_back = False
def _compute_is_active(self):
current_user_id = self.env.user.id