[FIX] timesheet_exception: modify code to check "validated" is set in "vals"

H11047
This commit is contained in:
percyhibou
2022-10-06 18:17:23 +00:00
parent 6cdc24609f
commit c0ec8ec69f
2 changed files with 5 additions and 5 deletions

View File

@@ -34,10 +34,10 @@ class AnalyticLine(models.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() and 'stage_id' in vals:
for timesheet in self:
if timesheet.with_context(newVals=vals).detect_exceptions():
return self._popup_exceptions()
return super().write(vals)