From d5242066bd86cf00e59381bcc7aa47de0ffc9ea0 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Wed, 14 Oct 2020 09:10:03 +0000 Subject: [PATCH] [FIX] account: do not set default account Do not set a default `account_id` for section and note lines. Indeed, when set the constraint `check_non_accountable_fields_null` will raise. fine-tuning of c22f99dd09b0f8381a888ae065d66bb96da3b248 opw-2357415 opw-2355559 opw-2359283 closes odoo/odoo#59988 X-original-commit: b6791a5183ef1015b47312785501a99ed68e5718 Signed-off-by: Jorge Pinna Puissant (jpp) --- 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 be8aa5759dc..7a2e8e41ee4 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3929,7 +3929,7 @@ class AccountMoveLine(models.Model): if 'account_id' in default_fields and not values.get('account_id'): if len(move.line_ids[-2:]) == 2 and move.line_ids[-1].account_id == move.line_ids[-2].account_id != False: values['account_id'] = move.line_ids[-2:].mapped('account_id').id - if values.get('display_type'): + if values.get('display_type') or self.display_type: values.pop('account_id', None) return values