Skip to content

Commit 782c43c

Browse files
committed
[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#87445 Signed-off-by: Florian Gilbert <[email protected]>
1 parent a63bb17 commit 782c43c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

addons/l10n_nl/models/account_journal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ def _fill_missing_values(self, vals):
1414
return
1515

1616
company = self.env['res.company'].browse(vals['company_id']) if vals.get('company_id') else self.env.company
17-
if company.country_id.code == "NL":
18-
type_control_ids = vals.get('type_control_ids', [])
19-
type_control_ids.append(self.env.ref('account.data_account_type_direct_costs').id)
17+
if company.country_id.code == "NL" and not vals.get('type_control_ids')[0][2]:
18+
type_control_ids = self.env.ref('account.data_account_type_direct_costs').ids
2019
vals['type_control_ids'] = [(6, 0, type_control_ids)]
2120

2221
@api.model

0 commit comments

Comments
 (0)