Skip to content

Commit

Permalink
Merge pull request osbzr#1886 from floraXiao/master
Browse files Browse the repository at this point in the history
[FIX]修复作废时只能移除第一个审批组的bug,作废时应全部移除待审批人
  • Loading branch information
floraXiao authored Jul 16, 2018
2 parents be59fd1 + f2e3c20 commit 6fb48f4
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions good_process/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,6 @@ def good_process_refused(self, active_id, active_model):
return_vals = u'已经通过不能拒绝!'
return return_vals, message or ''

def remove_approver(self):
'''移除待审批人'''
manger_row = self.__has_manager__(self.id, self._name)

if (manger_row and manger_row.user_id.id == self.env.uid) or not manger_row:
manger_user = []
if manger_row:
manger_user = [manger_row.user_id.id]
self.__is_departement_manager__(manger_row)
users, can_clean_groups = (self.__get_user_group__(
self.id, self._name, manger_user, self))
self.__remove_approver__(
self.id, self._name, users, can_clean_groups)

def is_current_model(self):
"""检查是否是当前对象"""
action_id = self.env.context.get('params', False) \
Expand Down Expand Up @@ -216,7 +202,8 @@ def write(self, vals):
raise ValidationError(u"已审批不可作废")
if len(th._to_approver_ids) < th._approver_num:
raise ValidationError(u"审批中不可作废")
th.remove_approver()
for approver in th._to_approver_ids:
approver.unlink()
return super(MailThread, self).write(vals)

# 已提交,确认时报错
Expand Down

0 comments on commit 6fb48f4

Please sign in to comment.