Skip to content

Commit d23cedb

Browse files
committed
[OU-FIX] point_of_sale: No journal code duplication
If there's more than one payment method without journal, there was a crash due to journal code duplication. This commit fixes that giving a unique journal code.
1 parent 98bc2da commit d23cedb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openupgrade_scripts/scripts/point_of_sale/15.0.1.0.1/post-migration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ def _update_pos_payment_method_journal(env):
1414
("type", "=", "bank"),
1515
]
1616
)
17-
for method in payment_methods:
17+
for i, method in enumerate(payment_methods):
1818
method.journal_id = env["account.journal"].create(
1919
{
2020
"type": "bank",
2121
"name": f"[openupgrade] Journal for {method.name}",
22-
"code": "POS_BANK",
22+
"code": "POS%s" % i,
2323
"company_id": method.company_id.id,
2424
"sequence": 99,
2525
}

0 commit comments

Comments
 (0)