From 30e5e58f3c491d6b90afde88987b7731f2f836ff Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 8 Dec 2020 13:33:54 +0000 Subject: [PATCH] [FIX] account: Register payment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: - Create a customer invoice I for a total of 1000€ - Confirm I - Register a payment Bug: The default amout in the wizard was 0€ instead of 1000€ The default amount is computed by _get_wizard_values_from_batch with the sum of amount_residual of all the lines. But in function _compute_amount_residual, it checked line.id and this case, all the lines were in cache with NewId opw:2413064 closes odoo/odoo#63050 X-original-commit: f734b1cdc2780107ce690306aa1bc0acb9f13161 Signed-off-by: Simon Goffin (sig) --- addons/account/wizard/account_payment_register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py index 2d19473ca2e..279e880489f 100644 --- a/addons/account/wizard/account_payment_register.py +++ b/addons/account/wizard/account_payment_register.py @@ -140,7 +140,7 @@ class AccountPaymentRegister(models.TransientModel): ''' self.ensure_one() - lines = self.line_ids + lines = self.line_ids._origin if len(lines.company_id) > 1: raise UserError(_("You can't create payments for entries belonging to different companies."))