This commit is contained in:
Chill
2024-02-29 17:58:24 +08:00
10 changed files with 25 additions and 23 deletions

View File

@@ -18,7 +18,7 @@
from odoo import api, SUPERUSER_ID, _ from odoo import api, SUPERUSER_ID, _
def pre_init_hook(cr): def pre_init_hook(env):
""" """
数据初始化,只在安装时执行,更新时不执行 数据初始化,只在安装时执行,更新时不执行
""" """
@@ -26,25 +26,24 @@ def pre_init_hook(cr):
pass pass
def post_init_hook(cr, registry): def post_init_hook(env):
""" """
数据初始化,只在安装后执行,更新时不执行 数据初始化,只在安装后执行,更新时不执行
""" """
try: try:
env = api.Environment(cr, SUPERUSER_ID, {'active_test': False}) ids = env['product.category'].sudo().with_context(lang='zh_CN', active_test=False).search([
ids = env['product.category'].sudo().with_context(lang='zh_CN').search([
('parent_id', '!=', False) ('parent_id', '!=', False)
], order='parent_path') ], order='parent_path')
for rec in ids: for rec in ids:
rec._compute_complete_name() rec._compute_complete_name()
ids = env['stock.location'].sudo().with_context(lang='zh_CN').search([ ids = env['stock.location'].sudo().with_context(lang='zh_CN', active_test=False).search([
('location_id', '!=', False), ('location_id', '!=', False),
('usage', '!=', 'views'), ('usage', '!=', 'views'),
], order='parent_path') ], order='parent_path')
for rec in ids: for rec in ids:
rec._compute_complete_name() rec._compute_complete_name()
# 超级用户改时区为中国 # 超级用户改时区为中国
ids = env['res.users'].sudo().with_context(lang='zh_CN').browse([1, 2]) ids = env['res.users'].sudo().with_context(lang='zh_CN', active_test=False).browse([1, 2])
ids.write({'tz': "Etc/GMT-8"}) ids.write({'tz': "Etc/GMT-8"})
# 公司价格改人民币 # 公司价格改人民币
ids = env['res.company'].sudo().search([], limit=1) ids = env['res.company'].sudo().search([], limit=1)
@@ -57,7 +56,7 @@ def post_init_hook(cr, registry):
except Exception as e: except Exception as e:
raise Warning(e) raise Warning(e)
def uninstall_hook(cr, registry): def uninstall_hook(env):
""" """
数据初始化,卸载时执行 数据初始化,卸载时执行
""" """

View File

@@ -18,15 +18,15 @@
from odoo import api, SUPERUSER_ID, _ from odoo import api, SUPERUSER_ID, _
def pre_init_hook(cr): def pre_init_hook(env):
pass pass
# cr.execute("") # cr.execute("")
def post_init_hook(cr, registry): def post_init_hook(env):
pass pass
# cr.execute("") # cr.execute("")
def uninstall_hook(cr, registry): def uninstall_hook(env):
pass pass
# cr.execute("") # cr.execute("")

View File

@@ -18,32 +18,31 @@
from odoo import api, SUPERUSER_ID, _ from odoo import api, SUPERUSER_ID, _
def pre_init_hook(cr): def pre_init_hook(env):
try: try:
# 更新企业版指向 # 更新企业版指向
sql = "UPDATE ir_module_module SET website = '%s' WHERE license like '%s' and website <> ''" % ('https://www.odooai.cn', 'OEEL%') sql = "UPDATE ir_module_module SET website = '%s' WHERE license like '%s' and website <> ''" % ('https://www.odooai.cn', 'OEEL%')
cr.execute(sql) env.cr.execute(sql)
cr.commit() env.cr.commit()
except Exception as e: except Exception as e:
pass pass
def post_init_hook(cr): def post_init_hook(env):
# a = check_module_installed(cr, ['app_web_superbar','aaaaa']) # a = check_module_installed(cr, ['app_web_superbar','aaaaa'])
pass pass
# cr.execute("") # cr.execute("")
def uninstall_hook(cr, registry): def uninstall_hook(env):
""" """
数据初始化,卸载时执行 数据初始化,卸载时执行
""" """
pass pass
def check_module_installed(cr, modules): def check_module_installed(env, modules):
# modules 输入参数是个 list如 ['base', 'sale'] # modules 输入参数是个 list如 ['base', 'sale']
env = api.Environment(cr, SUPERUSER_ID, {})
installed = False installed = False
m = env['ir.module.module'].sudo().search([('name', 'in', modules), ('state', 'in', ['installed', 'to install', 'to upgrade'])]) m = env['ir.module.module'].sudo().search([('name', 'in', modules), ('state', 'in', ['installed', 'to install', 'to upgrade'])])
if len(m) == len(modules): if len(m) == len(modules):
installed = True installed = True
return len(m) return installed

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 KiB

After

Width:  |  Height:  |  Size: 548 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -20,7 +20,7 @@
<section class="container app"> <section class="container app">
<div class="oe_row oe_spaced" style="max-width: 95%;"> <div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="row"> <div class="row">
<h2 class="oe_slogan">This is a Long Term Support Apps.Update: v17.24.02.27</h2> <h2 class="oe_slogan">This is a Long Term Support Apps.Update: v17.24.03.01</h2>
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;"> <div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item">1. Deletes Odoo label in footer</li> <li class="list-group-item">1. Deletes Odoo label in footer</li>
@@ -299,6 +299,10 @@
<div class="row"> <div class="row">
<h2 class="oe_slogan">This is a Long Term Support Apps.</h2> <h2 class="oe_slogan">This is a Long Term Support Apps.</h2>
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;"> <div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<h3>Update: v17.24.03.01</h3>
<p>Add more function for odoo 17.Dialog, language switcher.</p>
<h3>Update: v17.24.02.26</h3>
<p>Fix bug for odoo 17 origin update.</p>
<h3>Update: v16.23.09.13</h3> <h3>Update: v16.23.09.13</h3>
<p>UI enhance. follow odoo16 setup UI.</p> <p>UI enhance. follow odoo16 setup UI.</p>
<p>46. Add Help documentation anywhere. easy get help for any odoo operation or action.</p> <p>46. Add Help documentation anywhere. easy get help for any odoo operation or action.</p>

View File

@@ -17,7 +17,7 @@
<template id="replace_copyright_name" name="Copyright Name" inherit_id="web.frontend_layout"> <template id="replace_copyright_name" name="Copyright Name" inherit_id="web.frontend_layout">
<xpath expr="//span[hasclass('o_footer_copyright_name')]" position="replace"> <xpath expr="//span[hasclass('o_footer_copyright_name')]" position="replace">
<span class="o_footer_copyright_name me-2">Copyright &amp;copy; <span class="o_footer_copyright_name me-2">Copyright &amp;copy;
<span class="copyright_name_before" contenteditable="true">2009-2023 </span> <span class="copyright_name_before" contenteditable="true">2009-2024 </span>
<span t-field="res_company.name" itemprop="name"/> <span t-field="res_company.name" itemprop="name"/>
<span class="copyright_name_after" contenteditable="true"></span> <span class="copyright_name_after" contenteditable="true"></span>
</span> </span>

View File

@@ -7,7 +7,7 @@
<field name="priority">20</field> <field name="priority">20</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/> <field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//app[@name='general_settings']" position="after"> <xpath expr="//app[@name='general_settings']" position="before">
<app class="app_settings_block ml8" data-string="OEM &amp; Boost" string="OEM &amp; Boost" <app class="app_settings_block ml8" data-string="OEM &amp; Boost" string="OEM &amp; Boost"
name="app_odoo_customize" data-key="app_odoo_customize" logo="/app_odoo_customize/static/description/icon.png">> name="app_odoo_customize" data-key="app_odoo_customize" logo="/app_odoo_customize/static/description/icon.png">>
<div class="row app_settings_header my-0 ms-0 mw-100 bg-warning bg-opacity-25"> <div class="row app_settings_header my-0 ms-0 mw-100 bg-warning bg-opacity-25">

View File

@@ -41,7 +41,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<!--点击模块看详情--> <!--点击模块看详情-->
<xpath expr="//div[hasclass('oe_module_vignette')]" position="attributes" groups="app_odoo_customize.group_show_quick_upgrade"> <xpath expr="//div[hasclass('oe_module_vignette')]" position="attributes" groups="app_odoo_customize.group_show_quick_upgrade">
<attribute name="class">oe_module_vignette oe_kanban_global_click</attribute> <attribute name="class" position="add" separator=" ">oe_kanban_global_click</attribute>
</xpath> </xpath>
<!--让模块名更显眼--> <!--让模块名更显眼-->
<xpath expr="//div[hasclass('oe_module_desc')]//code" position="replace"/> <xpath expr="//div[hasclass('oe_module_desc')]//code" position="replace"/>

View File

@@ -7,7 +7,7 @@
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" /> <field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<setting id="appstore" position="attributes"> <setting id="appstore" position="attributes">
<attribute name="class">o_hidden</attribute> <attribute name="invisible">1</attribute>
</setting> </setting>
</field> </field>
</record> </record>