Skip to content

Commit 079f29d

Browse files
committed
[Fix] account: fix assing journal xmlids
1 parent 1738f1c commit 079f29d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

openupgrade_scripts/scripts/account/17.0.1.2/end-migration.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ def _assign_journal_xmlids(env):
2121
for xmlid, journal_data in list(
2222
template_data.get("account.journal", {}).items()
2323
):
24-
if not env.ref(xmlid, raise_if_not_found=False) and "type" in journal_data:
24+
if (
25+
not env.ref(xmlid, raise_if_not_found=False)
26+
and "type" in journal_data
27+
and "code" in journal_data
28+
):
2529
journal = existing_journals.filtered(
26-
lambda j: j.type == journal_data["type"] # noqa: B023
27-
)[:1]
30+
lambda j: j.type == journal_data["type"]
31+
and j.code == journal_data["code"] # noqa: B023
32+
)
2833
if journal:
2934
existing_journals -= journal
3035
env["ir.model.data"]._update_xmlids(

0 commit comments

Comments
 (0)