[FIX] account: get credit and debit regarding to company
Detected with OPW 1920765 Reproduce : set multi-companies, install accounting. The due amount for all companies is the sum of the due amount for every single company Cause : the context for company_id is not set in account.move.line:_query_get Solution : set it in res.partner:_credit_debit_get in case _query_get is used elsewhere closes odoo/odoo#30463
This commit is contained in:
@@ -204,7 +204,7 @@ class ResPartner(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _credit_debit_get(self):
|
||||
tables, where_clause, where_params = self.env['account.move.line']._query_get()
|
||||
tables, where_clause, where_params = self.env['account.move.line'].with_context(company_id=self.env.user.company_id.id)._query_get()
|
||||
where_params = [tuple(self.ids)] + where_params
|
||||
if where_clause:
|
||||
where_clause = 'AND ' + where_clause
|
||||
|
||||
Reference in New Issue
Block a user