mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] timesheet_exception: narrow down when to _popup_exceptions() on write() calls
H11047
This commit is contained in:
@@ -30,20 +30,14 @@ class AnalyticLine(models.Model):
|
||||
res.detect_exceptions()
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _exception_rule_eval_context(self, rec):
|
||||
res = super(AnalyticLine, self)._exception_rule_eval_context(rec)
|
||||
res['timesheet'] = rec
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _reverse_field(self):
|
||||
return 'timesheet_ids'
|
||||
|
||||
def write(self, vals):
|
||||
def write(self, vals):
|
||||
if not vals.get('ignore_exception'):
|
||||
for timesheet in self:
|
||||
if timesheet.detect_exceptions():
|
||||
if timesheet.detect_exceptions() and 'stage_id' in vals:
|
||||
return self._popup_exceptions()
|
||||
return super().write(vals)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user