[FIX] l10n_nl: traceback on purchase journal creation

With l10n_nl, create a purchase journal -> traceback
Ids was appended to ORM command list, instead of the ids list.
Moreover, it was filled even if there were no missing value.

opw-2801012

closes odoo/odoo#88732

X-original-commit: 2d6d6e81f53239942f549b16b11faf1b8f77cf41
Signed-off-by: Florian Gilbert <flg@odoo.com>
This commit is contained in:
Guillaume (guva)
2022-04-14 13:04:52 +02:00
parent a110ddc509
commit 71050fb0fe
+2 -3
View File
@@ -14,9 +14,8 @@ class AccountJournal(models.Model):
return
company = self.env['res.company'].browse(vals['company_id']) if vals.get('company_id') else self.env.company
if company.country_id.code == "NL":
type_control_ids = vals.get('type_control_ids', [])
type_control_ids.append(self.env.ref('account.data_account_type_direct_costs').id)
if company.country_id.code == "NL" and not vals.get('type_control_ids', [(6, 0, [])])[0][2]:
type_control_ids = self.env.ref('account.data_account_type_direct_costs').ids
vals['type_control_ids'] = [(6, 0, type_control_ids)]
@api.model