İlk versiyon: MyMach Fleet Intelligence ve yapılandırmalar

This commit is contained in:
cerenX9
2026-07-20 19:41:40 +03:00
commit f497805d08
85 changed files with 7071 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
env = env(user=1)
cr = env.cr
# 1. Reset stuck modules
cr.execute("UPDATE ir_module_module SET state = 'installed' WHERE state IN ('to install', 'to upgrade', 'to remove');")
# 2. Ensure group_user exists in res_groups and ir_model_data
cr.execute("SELECT id FROM res_groups LIMIT 1;")
group_res = cr.fetchone()
if not group_res:
cr.execute("""INSERT INTO res_groups (name, create_date, write_date) VALUES ('{"en_US": "Internal User"}', NOW(), NOW()) RETURNING id;""")
group_id = cr.fetchone()[0]
else:
group_id = group_res[0]
cr.execute("""
INSERT INTO ir_model_data (module, name, model, res_id)
VALUES ('base', 'group_user', 'res.groups', %s)
ON CONFLICT (module, name) DO UPDATE SET res_id = EXCLUDED.res_id;
""", (group_id,))
cr.commit()
print("SUCCESS: group_user XML ID restored!")