mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt event
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
{
|
||||
'name': 'odoo中文版套件之基础,中国会计基础,Chinese Enhance All in One,',
|
||||
'version': '16.23.11.10',
|
||||
'version': '16.23.11.17',
|
||||
'author': 'odooai.cn',
|
||||
'category': 'Base',
|
||||
'website': 'https://www.odooai.cn',
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- Price list -->
|
||||
<record id="product.list0" model="product.pricelist">
|
||||
<field name="currency_id" ref="base.CNY"/>
|
||||
</record>
|
||||
<!-- <record id="product.list0" model="product.pricelist">-->
|
||||
<!-- <field name="currency_id" ref="base.CNY"/>-->
|
||||
<!-- </record>-->
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- Currencies -->
|
||||
<record id="base.USD" model="res.currency">
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
<record id="base.EUR" model="res.currency">
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
<!-- <record id="base.USD" model="res.currency">-->
|
||||
<!-- <field name="active" eval="False"/>-->
|
||||
<!-- </record>-->
|
||||
<!-- <record id="base.EUR" model="res.currency">-->
|
||||
<!-- <field name="active" eval="False"/>-->
|
||||
<!-- </record>-->
|
||||
<record id="base.CNY" model="res.currency" context="{'lang': 'zh_CN'}">
|
||||
<field name="full_name">人民币</field>
|
||||
<field name="active" eval="True"/>
|
||||
|
||||
@@ -31,7 +31,7 @@ def post_init_hook(cr, registry):
|
||||
数据初始化,只在安装后执行,更新时不执行
|
||||
"""
|
||||
try:
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
env = api.Environment(cr, SUPERUSER_ID, {'active_test': False})
|
||||
ids = env['product.category'].sudo().with_context(lang='zh_CN').search([
|
||||
('parent_id', '!=', False)
|
||||
], order='parent_path')
|
||||
@@ -43,9 +43,24 @@ def post_init_hook(cr, registry):
|
||||
], order='parent_path')
|
||||
for rec in ids:
|
||||
rec._compute_complete_name()
|
||||
# 超级用户改时区为中国
|
||||
ids = env['res.users'].sudo().with_context(lang='zh_CN').browse([1, 2])
|
||||
ids.write({'tz': "Etc/GMT-8"})
|
||||
# 超级用户及模板用户改时区为中国
|
||||
ids = env['res.users'].sudo().with_context(lang='zh_CN').browse([1,2,3,4,5])
|
||||
# rec_extra = env.ref('base.template_portal_user_id')
|
||||
# if rec_extra:
|
||||
# ids += rec_extra
|
||||
ids.write({
|
||||
'tz': "Etc/GMT-8",
|
||||
'lang': "zh_CN",
|
||||
})
|
||||
# 公司价格改人民币
|
||||
env = api.Environment(cr, SUPERUSER_ID, {'active_test': True})
|
||||
ids = env['res.company'].sudo().search([], limit=1)
|
||||
if ids:
|
||||
ids.write({'currency_id': env.ref('base.CNY').id})
|
||||
# 价格表改人民币
|
||||
ids = env['product.pricelist'].sudo().search([], limit=1)
|
||||
if ids:
|
||||
ids.write({'currency_id': env.ref('base.CNY').id})
|
||||
except Exception as e:
|
||||
raise Warning(e)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user