添加功能
This commit is contained in:
@@ -114,20 +114,19 @@ class IssueLibrary(models.Model):
|
||||
is_push_depart = fields.Boolean(string="部门推送")
|
||||
is_meeting = fields.Boolean(string="已过会", compute='_compute_meeting', store=True)
|
||||
|
||||
def log_avoidance(self, avoid_employee_ids, avoid_comment=''):
|
||||
def log_avoidance(self, avoid_user, avoid_comment=''):
|
||||
"""记录回避信息,已存在的回避人不重复创建"""
|
||||
for employee_id in avoid_employee_ids:
|
||||
existing = self.env['issue.library.avoid.line'].search([
|
||||
('issue_library_id', '=', self.id),
|
||||
('avoid_user_id', '=', employee_id.user_id.id),
|
||||
], limit=1)
|
||||
if not existing:
|
||||
self.env['issue.library.avoid.line'].create({
|
||||
'issue_library_id': self.id,
|
||||
'avoid_user_id': employee_id.user_id.id,
|
||||
'avoid_date': fields.Datetime.now(),
|
||||
'avoid_comment': avoid_comment,
|
||||
})
|
||||
existing = self.env['issue.library.avoid.line'].search([
|
||||
('issue_library_id', '=', self.id),
|
||||
('avoid_user_id', '=', avoid_user.id),
|
||||
], limit=1)
|
||||
if not existing:
|
||||
self.env['issue.library.avoid.line'].create({
|
||||
'issue_library_id': self.id,
|
||||
'avoid_user_id': avoid_user.id,
|
||||
'avoid_date': fields.Datetime.now(),
|
||||
'avoid_comment': avoid_comment,
|
||||
})
|
||||
|
||||
def correction_confirm(self):
|
||||
for rec in self:
|
||||
|
||||
Reference in New Issue
Block a user