Skip to content
Permalink
Browse files

[FIX] account, analytic: remove company_ids context key mechanism

  • Loading branch information...
Feyensv committed Oct 14, 2019
1 parent 150931a commit a4b1cd9b7c1be5b3b7c7ff625a1430863eadd723
Showing with 8 additions and 6 deletions.
  1. +4 −3 addons/account/models/account_move.py
  2. +4 −3 addons/analytic/models/analytic_account.py
@@ -3797,9 +3797,10 @@ def _query_get(self, domain=None):

if context.get('company_id'):
domain += [('company_id', '=', context['company_id'])]

if 'company_ids' in context:
domain += [('company_id', 'in', context['company_ids'])]
elif context.get('allowed_company_ids'):
domain += [('company_id', 'in', self.env.companies.ids)]
else:
domain += [('company_id', '=', self.env.company.id)]

if context.get('reconcile_date'):
domain += ['|', ('reconciled', '=', False), '|', ('matched_debit_ids.max_date', '>', context['reconcile_date']), ('matched_credit_ids.max_date', '>', context['reconcile_date'])]
@@ -82,16 +82,17 @@ def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=Fals
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):
domain.append(('date', '<=', self._context['to_date']))
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(

0 comments on commit a4b1cd9

Please sign in to comment.
You can’t perform that action at this time.