[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 c22f99dd09

opw-2357415
opw-2355559
opw-2359283

closes odoo/odoo#59988

X-original-commit: b6791a5183ef1015b47312785501a99ed68e5718
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2020-10-14 11:24:34 +00:00
parent 1767b6eedc
commit d5242066bd
+1 -1
View File
@@ -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