fix bg_color

This commit is contained in:
ivan deng
2019-04-28 17:34:12 +08:00
parent fd9f2c5fd7
commit ecdb302246
2 changed files with 17 additions and 3 deletions

View File

@@ -15,6 +15,9 @@
# https://www.sunpop.cn/odoo10_developer_document_offline/
# description:
from odoo import api, SUPERUSER_ID, _
def pre_init_hook(cr):
try:
# 更新企业版指向
@@ -24,5 +27,16 @@ def pre_init_hook(cr):
pass
def post_init_hook(cr, registry):
# a = check_module_installed(cr, ['app_web_superbar','aaaaa'])
pass
# cr.execute("")
def check_module_installed(cr, modules):
# modules 输入参数是个 list如 ['base', 'sale']
env = api.Environment(cr, SUPERUSER_ID, {})
installed = False
m = env['ir.module.module'].sudo().search([('name', 'in', modules), ('state', 'in', ['installed', 'to install', 'to upgrade'])])
if len(m) == len(modules):
installed = True
return len(m)