diff options
| author | Laurent Smet <las@odoo.com> | 2020-12-03 14:08:37 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2020-12-03 14:19:46 +0000 |
| commit | 28bc59e794f15bf4f7de31e24f496e707ba639dc (patch) | |
| tree | dc81dd17f405c40b065342d57e8edcb9bb5f4dc3 /addons | |
| parent | b2d57323caf9f7fe47c4fe9ac26b0e955d9987b9 (diff) | |
[FIX] account: Fix payment consistency with edited journal configuration
After a migration, if the payment is using the bank account instead of the oustanding one, we shouldn't block the user in any case when checking the payment consistency.
For example, when writing the matching number on a journal item will trigger the check consistency on the payment. So, you are unable to reconcile any journal items until you replace the account by the outstanding.
closes odoo/odoo#62834
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_payment.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 32f68b0c1d9..b6a5b128a54 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -158,7 +158,11 @@ class AccountPayment(models.Model): writeoff_lines = self.env['account.move.line'] for line in self.move_id.line_ids: - if line.account_id in (self.journal_id.payment_debit_account_id, self.journal_id.payment_credit_account_id): + if line.account_id in ( + self.journal_id.default_account_id, + self.journal_id.payment_debit_account_id, + self.journal_id.payment_credit_account_id, + ): liquidity_lines += line elif line.account_id.internal_type in ('receivable', 'payable') or line.partner_id == line.company_id.partner_id: counterpart_lines += line |
