17 lines
489 B
Python
17 lines
489 B
Python
# -*- coding: utf-8 -*-
|
|
env = env(user=1)
|
|
cr = env.cr
|
|
|
|
# 1. Clear manually inserted res_lang or link ir_model_data
|
|
cr.execute("SELECT id FROM res_lang WHERE code = 'en_US';")
|
|
lang_id = cr.fetchone()
|
|
if lang_id:
|
|
cr.execute("""
|
|
INSERT INTO ir_model_data (module, name, model, res_id)
|
|
VALUES ('base', 'lang_en', 'res.lang', %s)
|
|
ON CONFLICT (module, name) DO UPDATE SET res_id = EXCLUDED.res_id;
|
|
""", (lang_id[0],))
|
|
|
|
cr.commit()
|
|
print("Language XML ID fixed!")
|