summaryrefslogtreecommitdiff
path: root/addons/analytic/models
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2019-10-14 13:15:22 +0000
committerRaphael Collet <rco@odoo.com>2019-11-18 12:25:05 +0000
commit37b1689be7585e72eca2fce68fa70cfe45e314a0 (patch)
treee7ed71667ad1aece6db47742a71289434c8c5654 /addons/analytic/models
parentd52f8ce8b030159f05bacb7d07ed042b862274dd (diff)
[FIX] account, analytic: remove company_ids context key mechanism
Diffstat (limited to 'addons/analytic/models')
-rw-r--r--addons/analytic/models/analytic_account.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py
index 286ff4a66f5..d6945cfcda4 100644
--- a/addons/analytic/models/analytic_account.py
+++ b/addons/analytic/models/analytic_account.py
@@ -82,7 +82,10 @@ class AccountAnalyticAccount(models.Model):
def _compute_debit_credit_balance(self):
Curr = self.env['res.currency']
analytic_line_obj = self.env['account.analytic.line']
- domain = [('account_id', 'in', self.ids)]
+ domain = [
+ ('account_id', 'in', self.ids)
+ ('company_id', 'in', [False] + self.env.companies.ids)
+ ]
if self._context.get('from_date', False):
domain.append(('date', '>=', self._context['from_date']))
if self._context.get('to_date', False):
@@ -90,8 +93,6 @@ class AccountAnalyticAccount(models.Model):
if self._context.get('tag_ids'):
tag_domain = expression.OR([[('tag_ids', 'in', [tag])] for tag in self._context['tag_ids']])
domain = expression.AND([domain, tag_domain])
- if self._context.get('company_ids'):
- domain.append(('company_id', 'in', self._context['company_ids']))
user_currency = self.env.company.currency_id
credit_groups = analytic_line_obj.read_group(