update ent

This commit is contained in:
ivan deng
2022-12-28 18:42:57 +08:00
parent 1faee6813d
commit 16a7398b88
6 changed files with 89 additions and 57 deletions

View File

@@ -18,7 +18,7 @@
{
'name': "App base chinese中国化基本模块增强",
'version': '15.22.07.20',
'version': '13.21.01.02',
'author': 'Sunpop.cn',
'category': 'Base',
'website': 'https://www.sunpop.cn',
@@ -67,8 +67,7 @@
'views/sale_order_views.xml',
'views/account_move_views.xml',
'views/ir_default_views.xml',
# todo: set assets
# 'views/templates.xml',
'views/templates.xml',
'wizard/sale_make_invoice_advance_views.xml',
'data/ir_default_data.xml',
'data/base_data.xml',
@@ -92,7 +91,6 @@
],
'js': [
],
'post_init_hook': 'post_init_hook',
'installable': True,
'application': True,
'auto_install': False,

View File

@@ -1,7 +1,7 @@
id,name
stock.stock_location_locations_partner,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
stock.stock_location_customers,<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>λ
stock.stock_location_suppliers,<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
stock.stock_location_locations,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
stock.stock_location_locations_virtual,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
stock.stock_location_inter_wh,<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>λ
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 id name
2 stock.stock_location_locations_partner 往来单位
3 stock.stock_location_customers 客户区位
4 stock.stock_location_suppliers 供应商区位
5 stock.stock_location_locations 物理区位
6 stock.stock_location_locations_virtual 虚拟区位
7 stock.stock_location_inter_wh 内部中转区位

View File

@@ -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>

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from . import res_company
from . import res_partner
from . import res_currency
from . import product_category

View File

@@ -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})

View File

@@ -94,25 +94,25 @@
</field>
</record>
<!--res.partner open地址中国化 -->
<!-- <record id="app_view_partner_short_form" model="ir.ui.view">-->
<!-- <field name="name">app.res.partner.form</field>-->
<!-- <field name="model">res.partner</field>-->
<!-- <field name="inherit_id" ref="base.view_partner_short_form"/>-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//field[@name='street']" position="before">-->
<!-- <xpath expr="//field[@name='country_id']" position="move"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//field[@name='street']" position="before">-->
<!-- <xpath expr="//field[@name='state_id']" position="move"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//field[@name='street']" position="before">-->
<!-- <xpath expr="//field[@name='city']" position="move"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//field[@name='street']" position="before">-->
<!-- <xpath expr="//field[@name='zip']" position="move"/>-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
<record id="app_view_partner_short_form" model="ir.ui.view">
<field name="name">app.res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_short_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='street']" position="before">
<xpath expr="//field[@name='country_id']" position="move"/>
</xpath>
<xpath expr="//field[@name='street']" position="before">
<xpath expr="//field[@name='state_id']" position="move"/>
</xpath>
<xpath expr="//field[@name='street']" position="before">
<xpath expr="//field[@name='city']" position="move"/>
</xpath>
<xpath expr="//field[@name='street']" position="before">
<xpath expr="//field[@name='zip']" position="move"/>
</xpath>
</field>
</record>
<!--res.partner 私人地址中国化 -->
<record id="app_res_partner_view_form_private" model="ir.ui.view">
<field name="name">app.res.partner.view.form.private</field>