From 71f1b34490922faf357c6a7f793518ab233e4ef8 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 15 Apr 2020 07:02:00 +0000 Subject: [PATCH] [FIX] account: Invoice line account updated incorrectly Steps to reproduce the bug: - Let's consider the customer invoice journal J with the default credit account A1 - Let's consider a customer invoice I with one line L1 - On L1 is set account A2 and product P1 - Import on I a new line L2 with account A3 and product P2 Bug: The account of L1 was changed by A1 instead of keeping A2 opw:2230808 closes odoo/odoo#49582 X-original-commit: 115a18a1cdecdc6d76920efdf323fb91f2f408ee Signed-off-by: Simon Goffin (sig) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 663ad11a4f9..e1fcf38d1d6 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1584,7 +1584,7 @@ class AccountMove(models.Model): # Shortcut to load the demo data. # Doing line.account_id triggers a default_get(['account_id']) that could returns a result. # A section / note must not have an account_id set. - if not line._cache.get('account_id') and not line.display_type: + if not line._cache.get('account_id') and not line.display_type and not line._origin: line.account_id = line._get_computed_account() if not line.account_id: if self.is_sale_document(include_receipts=True):