mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt m2o
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
{
|
||||
'name': "App base chinese,中国化基本模块增强",
|
||||
'version': '14.20.10.05',
|
||||
'version': '14.21.03.22',
|
||||
'author': 'Sunpop.cn',
|
||||
'category': 'Base',
|
||||
'website': 'https://www.sunpop.cn',
|
||||
|
||||
8
app_base_chinese/data/crm_team_data.xml
Normal file
8
app_base_chinese/data/crm_team_data.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!--<record id="sales_team.team_sales_department" model="crm.team">-->
|
||||
<!--<field name="name">Sales</field>-->
|
||||
<!--</record>-->
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -10,7 +10,7 @@
|
||||
<!--设置默认时区为中国,注意select 类型要加 ""-->
|
||||
<record id="res_partner_tz_default" model="ir.default">
|
||||
<field name="field_id" eval="ref('base.field_res_partner__tz')"/>
|
||||
<field name="json_value">"Asia/Shanghai"</field>
|
||||
<field name="json_value">"Etc/GMT-8"</field>
|
||||
</record>
|
||||
<!--设置用户email在odoo内提醒-->
|
||||
<record id="res_user_notify_email_default" model="ir.default">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<data noupdate="0">
|
||||
<!-- 时间格式 -->
|
||||
<record id="base.lang_zh_CN" model="res.lang">
|
||||
<field name="date_format">%Y-%m-%d</field>
|
||||
|
||||
@@ -33,18 +33,18 @@ def post_init_hook(cr, registry):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
ids = env['product.category'].sudo().with_context(lang='zh_CN').search([
|
||||
('parent_id', '!=', False)
|
||||
], order='complete_name')
|
||||
], order='parent_path')
|
||||
for rec in ids:
|
||||
rec._compute_complete_name()
|
||||
ids = env['stock.location'].sudo().with_context(lang='zh_CN').search([
|
||||
('location_id', '!=', False),
|
||||
('usage', '!=', 'views'),
|
||||
], order='complete_name')
|
||||
], 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': "Asia/Shanghai"})
|
||||
ids.write({'tz': "Etc/GMT-8"})
|
||||
except Exception as e:
|
||||
raise Warning(e)
|
||||
|
||||
@@ -52,4 +52,4 @@ def uninstall_hook(cr, registry):
|
||||
"""
|
||||
数据初始化,卸载时执行
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import res_partner
|
||||
from . import res_company
|
||||
from . import res_currency
|
||||
from . import res_country
|
||||
from . import product_category
|
||||
from . import stock_location
|
||||
from . import account_tax_group
|
||||
|
||||
@@ -16,7 +16,7 @@ class ResCurrency(models.Model):
|
||||
:return 返回值是对应阿拉伯数字的绝对值的中文数字
|
||||
"""
|
||||
if self.name != 'CNY':
|
||||
return;
|
||||
return
|
||||
rmbmap = [u"零", u"壹", u"贰", u"叁", u"肆", u"伍", u"陆", u"柒", u"捌", u"玖"]
|
||||
unit = [u"分", u"角", u"元", u"拾", u"佰", u"仟", u"万", u"拾", u"佰", u"仟", u"亿",
|
||||
u"拾", u"佰", u"仟", u"万", u"拾", u"佰", u"仟", u"兆"]
|
||||
|
||||
Reference in New Issue
Block a user