@@ -75,6 +75,8 @@ class IssueLibrary(models.Model):
|
||||
is_push_boss = fields.Boolean(string="董事推送")
|
||||
is_push_depart = fields.Boolean(string="部门推送")
|
||||
|
||||
is_state_updated = fields.Boolean(string='状态是否已更新', default=False)
|
||||
|
||||
def issue_party_approval(self):
|
||||
issue_active_ids = self.env["issue.library"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id'))
|
||||
@@ -254,6 +256,9 @@ class IssueLibrary(models.Model):
|
||||
|
||||
def library_push(self):
|
||||
for rec in self:
|
||||
if rec.is_state_updated:
|
||||
continue
|
||||
|
||||
push_update_vals = {}
|
||||
if rec.is_party and (rec.is_party_passed == 'reject' or not rec.is_party_passed):
|
||||
push_update_vals['is_push_party'] = True
|
||||
@@ -266,9 +271,16 @@ class IssueLibrary(models.Model):
|
||||
|
||||
if push_update_vals:
|
||||
rec.write(push_update_vals)
|
||||
rec.write({
|
||||
'issue_state': 'to_approval'
|
||||
})
|
||||
if not rec.is_state_updated:
|
||||
rec.write({
|
||||
'issue_state': 'to_approval',
|
||||
'is_state_updated': True
|
||||
})
|
||||
else:
|
||||
rec.write({
|
||||
'issue_state': 'will'}
|
||||
)
|
||||
|
||||
|
||||
@api.onchange('is_legal_trial')
|
||||
def _onchange_is_legal_trial(self):
|
||||
|
||||
Reference in New Issue
Block a user