mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
prepare #IAXMX0 app_base_chinese,app_base_chinese_website和l10n_cn_standard_latest升级至18 置顶
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<!-- eval="('res.users', 'notification_type', 'inbox')"/>-->
|
||||
<!--设置产品默认是可库存产品-->
|
||||
<function model="ir.default" name="set"
|
||||
eval="('product.template', 'detailed_type', 'product')"/>
|
||||
eval="('product.template', 'type', 'consu')"/>
|
||||
<!--设置翻译导出默认中文-->
|
||||
<function model="ir.default" name="set"
|
||||
eval="('base.language.export', 'lang', 'zh_CN')"/>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<record id="sales_team.team_sales_department" model="crm.team" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">中国</field>
|
||||
</record>
|
||||
<record id="sales_team.team_sales_department" model="crm.team" context="{'lang': 'en'}">
|
||||
<field name="name">China</field>
|
||||
</record>
|
||||
<!-- <record id="sales_team.team_sales_department" model="crm.team" context="{'lang': 'en'}">-->
|
||||
<!-- <field name="name">China</field>-->
|
||||
<!-- </record>-->
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
from odoo import api, SUPERUSER_ID, _
|
||||
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
def pre_init_hook(cr):
|
||||
"""
|
||||
@@ -26,25 +28,24 @@ def pre_init_hook(cr):
|
||||
pass
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
def post_init_hook(env):
|
||||
"""
|
||||
数据初始化,只在安装后执行,更新时不执行
|
||||
"""
|
||||
try:
|
||||
env = api.Environment(cr, SUPERUSER_ID, {'active_test': False})
|
||||
ids = env['product.category'].sudo().with_context(lang='zh_CN').search([
|
||||
ids = env['product.category'].sudo().with_context(lang='zh_CN', active_test=False).search([
|
||||
('parent_id', '!=', False)
|
||||
], order='parent_path')
|
||||
for rec in ids:
|
||||
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),
|
||||
('usage', '!=', 'views'),
|
||||
], order='parent_path')
|
||||
for rec in ids:
|
||||
rec._compute_complete_name()
|
||||
# 超级用户及模板用户改时区为中国
|
||||
ids = env['res.users'].sudo().with_context(lang='zh_CN').browse([1,2,3,4,5])
|
||||
ids = env['res.users'].sudo().with_context(lang='zh_CN', active_test=False).browse([1, 2, 3, 4, 5])
|
||||
# rec_extra = env.ref('base.template_portal_user_id')
|
||||
# if rec_extra:
|
||||
# ids += rec_extra
|
||||
@@ -53,18 +54,23 @@ def post_init_hook(cr, registry):
|
||||
'lang': "zh_CN",
|
||||
})
|
||||
# 公司价格改人民币
|
||||
env = api.Environment(cr, SUPERUSER_ID, {'active_test': True})
|
||||
ids = env['res.company'].sudo().search([], limit=1)
|
||||
ids = env['res.company'].sudo().with_context(active_test=False).search([], limit=1)
|
||||
if ids:
|
||||
ids.write({'currency_id': env.ref('base.CNY').id})
|
||||
try:
|
||||
ids.write({'currency_id': env.ref('base.CNY').id})
|
||||
except Exception as e:
|
||||
_logger.error('cn: company write currency_id error.')
|
||||
# 价格表改人民币
|
||||
ids = env['product.pricelist'].sudo().search([], limit=1)
|
||||
ids = env['product.pricelist'].sudo().with_context(active_test=False).search([], limit=1)
|
||||
if ids:
|
||||
ids.write({'currency_id': env.ref('base.CNY').id})
|
||||
try:
|
||||
ids.write({'currency_id': env.ref('base.CNY').id})
|
||||
except Exception as e:
|
||||
_logger.error('cn: pricelist write currency_id error.')
|
||||
except Exception as e:
|
||||
raise Warning(e)
|
||||
|
||||
def uninstall_hook(cr, registry):
|
||||
def uninstall_hook(env):
|
||||
"""
|
||||
数据初始化,卸载时执行
|
||||
"""
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="inherit_id" ref="base.module_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='description_html']" position="before">
|
||||
<field name="description_html_cn" class="oe_styling_v8" attrs="{'invisible': [('description_html_cn', '=', False)]}"/>
|
||||
<field name="description_html_cn" class="oe_styling_v8" invisible="not description_html_cn"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -79,22 +79,23 @@
|
||||
</record>
|
||||
|
||||
<!--Partner kanban 视图,用继承方式改写2017-11-23,ivan-->
|
||||
<record id="app_res_partner_kanban_view" model="ir.ui.view">
|
||||
<field name="name">app.res.partner.kanban</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//templates" position="before">
|
||||
<field name="credit_limit"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('oe_kanban_details')]/div/ul" position="inside">
|
||||
<li t-if="record.credit_limit and record.credit_limit.raw_value">
|
||||
Credit:
|
||||
<field name="credit_limit"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- todo: 迁移到 app_base 等-->
|
||||
<!-- <record id="app_res_partner_kanban_view" model="ir.ui.view">-->
|
||||
<!-- <field name="name">app.res.partner.kanban</field>-->
|
||||
<!-- <field name="model">res.partner</field>-->
|
||||
<!-- <field name="inherit_id" ref="base.res_partner_kanban_view"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//templates" position="before">-->
|
||||
<!-- <field name="credit_limit"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- <xpath expr="//div[hasclass('oe_kanban_details')]/div/ul" position="inside">-->
|
||||
<!-- <li t-if="record.credit_limit and record.credit_limit.raw_value">-->
|
||||
<!-- Credit:-->
|
||||
<!-- <field name="credit_limit"/>-->
|
||||
<!-- </li>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<!--end客户-->
|
||||
|
||||
<!-- 为供应商菜单单独增加筛选器 2017-11-13 -->
|
||||
|
||||
Reference in New Issue
Block a user