diff options
| author | Laurent Smet <las@odoo.com> | 2021-05-11 12:59:42 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2021-05-11 12:59:42 +0000 |
| commit | 9b3506523659b06440b46664eeb83952cc30694e (patch) | |
| tree | d4473dedc89c35eb8cef19ce3cfc27bf8af7a3eb | |
| parent | 36866412483af80da812a38842e6df35b232190a (diff) | |
[FIX] account: Partial revert of https://github.com/odoo/odoo/commit/39fb6b2990e5d6fda0d5f12dbd64d26ef77b9d0c
It seems some ppl are sharing the same bank account accross multiple journals.
issues:
2527148
2527994
2527894
...
closes odoo/odoo#70676
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
| -rw-r--r-- | addons/account/models/account_journal.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 5819a53e970..ec2ea3504ed 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -656,6 +656,9 @@ 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. @@ -670,7 +673,6 @@ 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() |
