diff options
| author | Laurent Smet <las@odoo.com> | 2021-05-03 13:43:44 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2021-05-07 09:19:53 +0000 |
| commit | 39fb6b2990e5d6fda0d5f12dbd64d26ef77b9d0c (patch) | |
| tree | e78166ebf7515d9ce01c94cb6cd381b0844a73f2 /addons/account | |
| parent | 9a4e792c38124e1c3902b37ea4604a17788c7710 (diff) | |
[FIX] account: Fix dashboard 'Oustanding' amounts with shared outstanding accounts
- Share outstanding accounts between multiple journals
- Create payment for each of them
- Go to dashboard
=> "Outstanding Payments/Receipts" amounts are wrong
closes odoo/odoo#70262
Ticket: 2517499
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/account')
| -rw-r--r-- | addons/account/models/account_journal.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 5f10714ec19..5819a53e970 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -656,9 +656,6 @@ class AccountJournal(models.Model): def _get_journal_bank_account_balance(self, domain=None): ''' Get the bank balance of the current journal by filtering the journal items using the journal's accounts. - /!\ The current journal is not part of the applied domain. This is the expected behavior since we only want - a logic based on accounts. - :param domain: An additional domain to be applied on the account.move.line model. :return: Tuple having balance expressed in journal's currency along with the total number of move lines having the same account as of the journal's default account. @@ -673,6 +670,7 @@ class AccountJournal(models.Model): ('account_id', 'in', tuple(self.default_account_id.ids)), ('display_type', 'not in', ('line_section', 'line_note')), ('move_id.state', '!=', 'cancel'), + ('journal_id', '=', self.id), ] query = self.env['account.move.line']._where_calc(domain) tables, where_clause, where_params = query.get_sql() @@ -697,9 +695,6 @@ class AccountJournal(models.Model): ''' Get the outstanding payments balance of the current journal by filtering the journal items using the journal's accounts. - /!\ The current journal is not part of the applied domain. This is the expected behavior since we only want - a logic based on accounts. - :param domain: An additional domain to be applied on the account.move.line model. :param date: The date to be used when performing the currency conversions. :return: The balance expressed in the journal's currency. @@ -722,6 +717,7 @@ class AccountJournal(models.Model): ('display_type', 'not in', ('line_section', 'line_note')), ('move_id.state', '!=', 'cancel'), ('reconciled', '=', False), + ('journal_id', '=', self.id), ] query = self.env['account.move.line']._where_calc(domain) tables, where_clause, where_params = query.get_sql() |
