[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. opw-2241575 closes odoo/odoo#50040 X-original-commit: 997a98d2d3d12caf554040922876164040de9efa Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -3740,6 +3740,8 @@ 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'):
|
||||
values.pop('account_id', None)
|
||||
return values
|
||||
|
||||
@api.depends('ref', 'move_id')
|
||||
|
||||
Reference in New Issue
Block a user