mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
udpate base chinese
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
{
|
||||
'name': "App base chinese,中国化基本模块增强",
|
||||
'version': '14.21.03.22',
|
||||
'version': '14.23.02.02',
|
||||
'author': 'Sunpop.cn',
|
||||
'category': 'Base',
|
||||
'website': 'https://www.sunpop.cn',
|
||||
@@ -49,13 +49,15 @@
|
||||
12. 翻译导出默认中文,默认po
|
||||
13. 在 base 模型增加 name_en_US 字段,赋值后同时改翻译值
|
||||
14. 常用小数精度调整
|
||||
21. todo:中文演示数据(只有demo模式才加载)
|
||||
15. 销售团队改为中国
|
||||
21. todo:中文演示数据(只有demo模式才加载)
|
||||
""",
|
||||
'pre_init_hook': 'pre_init_hook',
|
||||
'post_init_hook': 'post_init_hook',
|
||||
'depends': [
|
||||
'app_base',
|
||||
'account',
|
||||
'sales_team',
|
||||
'stock',
|
||||
],
|
||||
'images': ['static/description/banner.jpg'],
|
||||
@@ -65,6 +67,7 @@
|
||||
'views/sale_order_views.xml',
|
||||
'views/account_move_views.xml',
|
||||
'views/ir_default_views.xml',
|
||||
'views/menu_views.xml',
|
||||
'views/templates.xml',
|
||||
'wizard/sale_make_invoice_advance_views.xml',
|
||||
'data/ir_default_data.xml',
|
||||
@@ -76,6 +79,7 @@
|
||||
'data/product_data.xml',
|
||||
'data/product_pricelist_data.xml',
|
||||
'data/stock_location_data.xml',
|
||||
'data/sales_team_data.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<data noupdate="1">
|
||||
<!-- Country -->
|
||||
<record id="base.cn" model="res.country">
|
||||
<field name="address_format" eval="'%(country_name)s,%(state_name)s%(city)s,%(zip)s\n%(street)s\n%(street2)s'"/>
|
||||
<field name="address_format" eval="'%(country_name)s%(state_name)s%(city)s%(street)s\n%(street2)s'"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
14
app_base_chinese/data/sales_team_data.xml
Normal file
14
app_base_chinese/data/sales_team_data.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- <record id="sales_team.team_sales_department" model="crm.team">-->
|
||||
<!-- <field name="name">中国</field>-->
|
||||
<!-- </record>-->
|
||||
<function model="crm.team" name="write">
|
||||
<value model="crm.team" eval="obj().env.ref('sales_team.team_sales_department').id"/>
|
||||
<value eval="{
|
||||
'name': '中国',
|
||||
}"/>
|
||||
</function>
|
||||
</data>
|
||||
</odoo>
|
||||
7
app_base_chinese/data/stock.location.csv
Normal file
7
app_base_chinese/data/stock.location.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
id,name
|
||||
stock.stock_location_locations_partner,往来单位
|
||||
stock.stock_location_customers,客户区位
|
||||
stock.stock_location_suppliers,供应商区位
|
||||
stock.stock_location_locations,物理区位
|
||||
stock.stock_location_locations_virtual,虚拟区位
|
||||
stock.stock_location_inter_wh,内部中转区位
|
||||
|
@@ -1,31 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="stock.removal_fifo" model="product.removal">
|
||||
<record id="stock.removal_fifo" model="product.removal" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">先进先出(FIFO)</field>
|
||||
</record>
|
||||
<record id="stock.removal_lifo" model="product.removal">
|
||||
<record id="stock.removal_lifo" model="product.removal" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">后进先出(LIFO)</field>
|
||||
</record>
|
||||
</data>
|
||||
<data noupdate="0">
|
||||
<record id="stock.stock_location_locations" model="stock.location">
|
||||
<field name="name">物理区位</field>
|
||||
</record>
|
||||
<record id="stock.stock_location_locations_partner" model="stock.location">
|
||||
<field name="name">往来单位</field>
|
||||
</record>
|
||||
<record id="stock.stock_location_locations_virtual" model="stock.location">
|
||||
<field name="name">虚拟区位</field>
|
||||
</record>
|
||||
<record id="stock.stock_location_suppliers" model="stock.location">
|
||||
<field name="name">供应商区位</field>
|
||||
</record>
|
||||
<record id="stock.stock_location_customers" model="stock.location">
|
||||
<field name="name">客户区位</field>
|
||||
</record>
|
||||
<record id="stock.stock_location_inter_wh" model="stock.location">
|
||||
<field name="name">内部中转区位</field>
|
||||
</record>
|
||||
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
|
||||
<value eval="[ref('stock.stock_location_locations', False)]"/>
|
||||
<value model="stock.location" eval="{
|
||||
'name': '物理区位',
|
||||
}"/>
|
||||
</function>
|
||||
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
|
||||
<value eval="[ref('stock.stock_location_locations_partner', False)]"/>
|
||||
<value model="stock.location" eval="{
|
||||
'name': '往来单位',
|
||||
}"/>
|
||||
</function>
|
||||
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
|
||||
<value eval="[ref('stock.stock_location_locations_virtual', False)]"/>
|
||||
<value model="stock.location" eval="{
|
||||
'name': '虚拟区位',
|
||||
}"/>
|
||||
</function>
|
||||
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
|
||||
<value eval="[ref('stock.stock_location_suppliers', False)]"/>
|
||||
<value model="stock.location" eval="{
|
||||
'name': '供应商区位',
|
||||
}"/>
|
||||
</function>
|
||||
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
|
||||
<value eval="[ref('stock.stock_location_customers', False)]"/>
|
||||
<value model="stock.location" eval="{
|
||||
'name': '客户区位',
|
||||
}"/>
|
||||
</function>
|
||||
<function model="stock.location" name="write" context="{'lang': 'zh_CN'}">
|
||||
<value eval="[ref('stock.stock_location_inter_wh', False)]"/>
|
||||
<value model="stock.location" eval="{
|
||||
'name': '中转区位',
|
||||
}"/>
|
||||
</function>
|
||||
<!-- 几个特殊区位处理-->
|
||||
<function model="res.company" name="_adjust_wh_cn_name"/>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<data noupdate="1">
|
||||
<!--
|
||||
Resource: res.partner.category
|
||||
-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<data noupdate="01>
|
||||
|
||||
<record id="base.res_partner_address_1" model="res.partner">
|
||||
<field name="image" type="base64" file="base/static/img/res_partner_address_1-image.png"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import res_company
|
||||
from . import res_partner
|
||||
from . import res_currency
|
||||
from . import product_category
|
||||
|
||||
@@ -7,11 +7,24 @@ from odoo.exceptions import UserError, ValidationError
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
short_name = fields.Char('Short Name', related='partner_id.short_name', readonly=False)
|
||||
|
||||
# 当传参 show_short_company 时,只显示简称
|
||||
def name_get(self):
|
||||
if self._context.get('show_short_company'):
|
||||
return [(value.id, "%s" % (value.short_name if value.short_name else value.name)) for value in self]
|
||||
else:
|
||||
return super().name_get()
|
||||
@api.model
|
||||
def _adjust_wh_cn_name(self):
|
||||
companys = self.env['res.company'].with_context(active_test=False, lang='zh_CN').search([])
|
||||
for rec in companys:
|
||||
# 修正区位名称
|
||||
ids = self.env['stock.location'].with_context(active_test=False).search(
|
||||
[('name', 'like', ': Transit Location'), ('company_id', '=', rec.id)])
|
||||
ids.write({'name': '%s: 中转区位' % rec.name})
|
||||
ids = self.env['stock.location'].with_context(active_test=False).search(
|
||||
[('name', 'like', ': Scrap'), ('company_id', '=', rec.id)])
|
||||
ids.write({'name': '%s: 报废区位' % rec.name})
|
||||
ids = self.env['stock.location'].with_context(active_test=False).search(
|
||||
[('name', 'like', ': Inventory adjustment'), ('company_id', '=', rec.id)])
|
||||
ids.write({'name': '%s: 盘点区位' % rec.name})
|
||||
# 注意,原生没有在生产中使用 _
|
||||
ids = self.env['stock.location'].with_context(active_test=False).search([
|
||||
('name', 'like', ': Production'), ('company_id', '=', rec.id)])
|
||||
ids.write({'name': '%s: 生产区位' % rec.name})
|
||||
ids = self.env['stock.location'].with_context(active_test=False).search([
|
||||
('name', 'like', ': Subcontracting Location'), ('company_id', '=', rec.id)])
|
||||
ids.write({'name': '%s: 委外区位' % rec.name})
|
||||
|
||||
@@ -26,7 +26,7 @@ class ResCurrency(models.Model):
|
||||
xflag = value
|
||||
value = abs(value)
|
||||
# 先把value 数字进行格式化保留两位小数,转成字符串然后去除小数点
|
||||
nums = map(int, list(str('%0.2f' % value).replace('.', '')))
|
||||
nums = list(map(int, list(str('%0.2f' % value).replace('.', ''))))
|
||||
words = []
|
||||
zflag = 0 # 标记连续0次数,以删除万字,或适时插入零字
|
||||
start = len(nums) - 3
|
||||
|
||||
@@ -8,12 +8,38 @@
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- 过帐操作-->
|
||||
<!-- 过帐操作-->
|
||||
<xpath expr="//header//button[@name='action_post']" position="attributes">
|
||||
<attribute name="string">Post Entry</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--名称优化-->
|
||||
<record id="account.action_move_out_invoice_type" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收发票</field>
|
||||
</record>
|
||||
<record id="account.action_move_out_refund_type" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收退款-红字发票</field>
|
||||
</record>
|
||||
<record id="account.action_move_out_receipt_type" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收收据(无销售订单)</field>
|
||||
</record>
|
||||
<record id="account.action_account_payments" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收支付</field>
|
||||
</record>
|
||||
|
||||
<record id="account.action_move_in_invoice_type" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付账单</field>
|
||||
</record>
|
||||
<record id="account.action_move_in_refund_type" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付退款</field>
|
||||
</record>
|
||||
<record id="account.action_move_in_receipt_type" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付收据(无采购订单)</field>
|
||||
</record>
|
||||
<record id="account.action_account_payments_payable" model="ir.actions.act_window" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付支付</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<data>
|
||||
<!-- currency视图, tree -->
|
||||
<record id="app_view_currency_tree" model="ir.ui.view">
|
||||
<field name="name">app.res.currency.tree</field>
|
||||
|
||||
28
app_base_chinese/views/menu_views.xml
Normal file
28
app_base_chinese/views/menu_views.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="account.menu_action_move_out_invoice_type" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收发票</field>
|
||||
</record>
|
||||
<record id="account.menu_action_move_out_refund_type" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收退款-红字发票</field>
|
||||
</record>
|
||||
<record id="account.menu_action_move_out_receipt_type" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收收据(无销售订单)</field>
|
||||
</record>
|
||||
<record id="account.menu_action_account_payments_receivable" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应收支付</field>
|
||||
</record>
|
||||
|
||||
<record id="account.menu_action_move_in_invoice_type" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付账单</field>
|
||||
</record>
|
||||
<record id="account.menu_action_move_in_refund_type" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付退款</field>
|
||||
</record>
|
||||
<record id="account.menu_action_move_in_receipt_type" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付收据(无采购订单)</field>
|
||||
</record>
|
||||
<record id="account.menu_action_account_payments_payable" model="ir.ui.menu" context="{'lang': 'zh_CN'}">
|
||||
<field name="name">应付支付</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<data>
|
||||
<!-- currency视图, tree -->
|
||||
<record id="app_ir_default_tree_view" model="ir.ui.view">
|
||||
<field name="name">app.ir.default tree view</field>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<data>
|
||||
<!-- Partner Form视图,用继承方式改写2018-11-21,ivan -->
|
||||
<record id="app_view_partner_form" model="ir.ui.view">
|
||||
<field name="name">app.res.partner.form</field>
|
||||
@@ -54,7 +54,10 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']//form[1]//field[@name='street']" position="before">
|
||||
<xpath expr="//field[@name='child_ids']//form[1]//field[@name='zip']" position="move"/>
|
||||
</xpath>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']//form[1]//field[@name='email']" position="before">
|
||||
<field name="category_id" widget="many2many_tags"/>
|
||||
</xpath>
|
||||
<!-- res.partner联系人 kanban -->
|
||||
<!-- 显示类型和地址等 -->
|
||||
<xpath expr="//field[@name='child_ids']//kanban[1]//templates//field[@name='name']" position="before">
|
||||
@@ -62,6 +65,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']//kanban[1]//templates//field[@name='name']" position="after">
|
||||
<div t-if="record.type and record.type.raw_value"><field name="type"/></div>
|
||||
<div t-if="record.category_id and record.category_id.raw_value"><field name="category_id" widget="many2many_tags"/></div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -113,7 +117,7 @@
|
||||
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='email']" position="after">
|
||||
<field name="category_id" optional="show"/>
|
||||
<field name="category_id" widget="many2many_tags" optional="show"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user