Skip to content

Commit 246bfc6

Browse files
authored
Merge pull request #5516 from guillermo2005200/18.0-fix-account-migration
[18.0][OU-FIX] account: Correctly populate code_store using Root Company ID fr…
2 parents 7b4687f + 7a33fa6 commit 246bfc6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openupgrade_scripts/scripts/account/18.0.1.3/post-migration.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ def account_account_code_fields(env):
147147
"""
148148
env.cr.execute(
149149
"""
150-
UPDATE account_account
151-
SET code_store=json_build_object(company_id, code)
150+
UPDATE account_account aa
151+
SET code_store=json_build_object(split_part(rc.parent_path, '/', 1), aa.code)
152+
FROM res_company rc
153+
WHERE aa.company_id = rc.id
152154
"""
153155
)
154156

0 commit comments

Comments
 (0)