summaryrefslogtreecommitdiff
path: root/addons/digest
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2019-09-14 11:42:45 +0000
committerRaphael Collet <rco@odoo.com>2019-11-18 12:25:05 +0000
commitce9fe1fcf680516e12d1e61a7305fdfb7ddbdc8f (patch)
treea270f9046e96b0d172e7def6e26d6c68c2df8144 /addons/digest
parent57b999d40ad89a80dd4ae40433d928c0f0d57b09 (diff)
[IMP] * : remove company context key
Diffstat (limited to 'addons/digest')
-rw-r--r--addons/digest/models/digest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/digest/models/digest.py b/addons/digest/models/digest.py
index 950794d29b3..c8f49d8967f 100644
--- a/addons/digest/models/digest.py
+++ b/addons/digest/models/digest.py
@@ -56,7 +56,7 @@ class Digest(models.Model):
digest.available_fields = ', '.join(kpis_values_fields)
def _get_kpi_compute_parameters(self):
- return fields.Date.to_string(self._context.get('start_date')), fields.Date.to_string(self._context.get('end_date')), self._context.get('company')
+ return fields.Date.to_string(self._context.get('start_date')), fields.Date.to_string(self._context.get('end_date')), self.env.company
def _compute_kpi_res_users_connected_value(self):
for record in self:
@@ -105,8 +105,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).with_user(user)
- previous_digest = self.with_context(start_date=tf[1][0], end_date=tf[1][1], company=company).with_user(user)
+ digest = self.with_context(start_date=tf[0][0], end_date=tf[0][1]).with_user(user).with_company(company)
+ previous_digest = self.with_context(start_date=tf[1][0], end_date=tf[1][1]).with_user(user).with_company(company)
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]: