Merge branch 'master' into dev_zhou

# Conflicts:
#	soong_workflow/wizard/soong_workflow_comment_wizard_view.xml
This commit is contained in:
李鹏宇
2026-06-11 10:28:22 +08:00
23 changed files with 625 additions and 62 deletions
@@ -846,16 +846,9 @@ class SoongWorkflowMixin(models.AbstractModel):
"default_trans_link_id": default_trans_link_id,
"all_workflow_links": allowed_link_ids,
"default_invalid_link_ids": invalid_links.ids,
"default_allowed_issue_ids": [(6, 0, self._get_avoid_issue_ids())],
},
}
def _get_avoid_issue_ids(self):
"""获取当前记录中可回避的议题ID列表"""
if hasattr(self, 'line_ids'):
return self.line_ids.mapped('issue_id').ids
return []
def get_all_sub_departments(self, department, level=0, print_tree=True):
all_departments = department.child_ids
@@ -36,32 +36,6 @@ class SoongWorkflowCommentWizard(models.TransientModel):
workflow_record_id = fields.Many2one('soong.workflow.record', string="流程")
is_selection = fields.Boolean(string="是否自动选择")
trans_link_id = fields.Many2one('trans.link', string='转交节点', ondelete='set null')
is_avoid = fields.Boolean(string='是否回避')
allowed_issue_ids = fields.Many2many('issue.library', 'soong_comment_wizard_allowed_issue_rel',
'wizard_id', 'issue_id', string='可选议题')
avoid_issue_ids = fields.Many2many('issue.library', 'soong_comment_wizard_avoid_issue_rel',
'wizard_id', 'issue_id', string='回避议题')
avoid_comment = fields.Char(string='回避意见')
@api.onchange('is_avoid')
def _onchange_is_avoid(self):
if not self.is_avoid:
self.avoid_issue_ids = [(5, 0, 0)]
self.avoid_comment = False
@api.onchange('is_avoid')
def _onchange_is_avoid(self):
if not self.is_avoid:
self.avoid_issue_ids = [(5, 0, 0)]
self.avoid_comment = False
def _handle_avoidance(self):
"""回避处理:勾选回避且选了议题时,在对应议题中记录回避"""
if not self.is_avoid or not self.avoid_issue_ids:
return
for issue in self.avoid_issue_ids:
issue.log_avoidance(self.env.user, self.avoid_comment or '')
document_ids = fields.Many2many('ir.attachment', string="附件")
return_link_id = fields.Many2one('trans.link', string='退回节点', ondelete='set null')
invalid_link_ids = fields.Many2many(
@@ -94,6 +68,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
employee_ids1 = fields.Many2many('hr.employee', 'employee_ids1_rel', 'custom_id1', 'employee_id1', string="人员范围", store=True)
employee_ids2 = fields.Many2many('hr.employee', 'employee_ids2_rel', 'custom_id2', 'employee_id2', string="加签传阅人员过滤")
@api.onchange('is_selection')
def _onchange_is_selection(self):
if not self.employee_ids1:
@@ -157,7 +132,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
])
self.employee_ids2 = self.env['hr.employee'].search(domain)
@api.depends('comment_note_id', 'comment_note', 'avoid_comment')
@api.depends('comment_note_id', 'comment_note')
def _compute_comment(self):
for record in self:
comment_parts = []
@@ -165,8 +140,6 @@ class SoongWorkflowCommentWizard(models.TransientModel):
comment_parts.append(record.comment_note_id.name)
if record.comment_note:
comment_parts.append(record.comment_note)
if record.avoid_comment:
comment_parts.append(f'【回避意见】{record.avoid_comment}')
record.comment = " ".join(comment_parts) if comment_parts else ""
@api.depends('user_id.employee_ids.user_role_ids', 'user_id.employee_ids.user_role_id')