diff options
| author | Raphael Collet <rco@odoo.com> | 2019-06-17 09:45:09 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2019-07-04 11:32:22 +0000 |
| commit | b7fd679a6c41dbb694c6fb2ce4911798de0424b1 (patch) | |
| tree | cb4e75910deb2516d5397925e96ab5e680eed9e1 /addons/digest/models | |
| parent | 1e6c3bec2c5ca621344b09e58dbed535e80fb343 (diff) | |
[FIX] *: sudo() -> with_user()
Diffstat (limited to 'addons/digest/models')
| -rw-r--r-- | addons/digest/models/digest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/digest/models/digest.py b/addons/digest/models/digest.py index 8d7f0cbf47d..14b777a5f33 100644 --- a/addons/digest/models/digest.py +++ b/addons/digest/models/digest.py @@ -109,8 +109,8 @@ class Digest(models.Model): self.ensure_one() res = {} for tf_name, tf in self._compute_timeframes(company).items(): - digest = self.with_context(start_date=tf[0][0], end_date=tf[0][1], company=company).sudo(user.id) - previous_digest = self.with_context(start_date=tf[1][0], end_date=tf[1][1], company=company).sudo(user.id) + digest = self.with_context(start_date=tf[0][0], end_date=tf[0][1], company=company).with_user(user) + previous_digest = self.with_context(start_date=tf[1][0], end_date=tf[1][1], company=company).with_user(user) kpis = {} for field_name, field in self._fields.items(): if field.type == 'boolean' and field_name.startswith(('kpi_', 'x_kpi_', 'x_studio_kpi_')) and self[field_name]: |
