mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update chinese city base
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
{
|
||||
'name': "App base chinese,中国化基本模块增强",
|
||||
'version': '13.19.12.24',
|
||||
'version': '13.20.01.11',
|
||||
'author': 'Sunpop.cn',
|
||||
'category': 'Base',
|
||||
'website': 'https://www.sunpop.cn',
|
||||
@@ -42,9 +42,9 @@
|
||||
6. 修正产品类别的列表及m2o字段中不显示中文目录名的Bug
|
||||
7. 修正仓库位置的列表及m2o字段中不显示中文目录名的Bug
|
||||
8. 超级用户改时区为 中国
|
||||
9. 时间格式年月日为 2019-12-30,时间为 22:10
|
||||
11. todo:中文演示数据(只有demo模式才加载)
|
||||
|
||||
9. 时间格式年月日为 2019-12-30,时间为 22:10
|
||||
10. 国家增加排序,中国排第一
|
||||
11. todo:中文演示数据(只有demo模式才加载)
|
||||
""",
|
||||
'pre_init_hook': 'pre_init_hook',
|
||||
'post_init_hook': 'post_init_hook',
|
||||
@@ -55,8 +55,10 @@
|
||||
'images': ['static/description/banner.jpg'],
|
||||
'data': [
|
||||
'views/res_partner_views.xml',
|
||||
'views/res_country_views.xml',
|
||||
'views/res_currency_views.xml',
|
||||
'views/ir_default_views.xml',
|
||||
'views/templates.xml',
|
||||
'data/ir_default_data.xml',
|
||||
'data/ir_sequence_data.xml',
|
||||
'data/base_data.xml',
|
||||
|
||||
@@ -44,6 +44,9 @@ def post_init_hook(cr, registry):
|
||||
('id', '=', 2)
|
||||
])
|
||||
ids.write({'tz': "Asia/Shanghai"})
|
||||
# 中国排序第一
|
||||
ids = env.ref('base.cn')
|
||||
ids.write({'sequence': 1})
|
||||
except Exception as e:
|
||||
raise Warning(e)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ from . import res_partner
|
||||
from . import res_currency
|
||||
from . import product_category
|
||||
from . import stock_location
|
||||
from . import res_country
|
||||
|
||||
|
||||
|
||||
|
||||
11
app_base_chinese/models/res_country.py
Normal file
11
app_base_chinese/models/res_country.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class Country(models.Model):
|
||||
_inherit = 'res.country'
|
||||
_order = 'sequence,name'
|
||||
|
||||
sequence = fields.Integer('Sequence', help="Determine the display order", default=99)
|
||||
26
app_base_chinese/static/src/scss/app_style.scss
Normal file
26
app_base_chinese/static/src/scss/app_style.scss
Normal file
@@ -0,0 +1,26 @@
|
||||
.o_form_view .o_address_format {
|
||||
.o_address_country {
|
||||
display: -webkit-inline-flex;
|
||||
display: inline-flex;
|
||||
width: 48%;
|
||||
margin-right: 2%;
|
||||
}
|
||||
}
|
||||
.o_form_view.o_form_editable .o_address_format {
|
||||
div.o_address_state {
|
||||
width: 50%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.o_address_city{
|
||||
width: 48%;
|
||||
margin-right: 2%;
|
||||
}
|
||||
.o_address_city_id{
|
||||
width: 48%;
|
||||
margin-right: 2%;
|
||||
}
|
||||
input.o_address_zip{
|
||||
width: 50%;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
28
app_base_chinese/views/res_country_views.xml
Normal file
28
app_base_chinese/views/res_country_views.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--目录list-->
|
||||
<record id="app_view_country_tree" model="ir.ui.view">
|
||||
<field name="name">res.country.tree</field>
|
||||
<field name="model">res.country</field>
|
||||
<field name="inherit_id" ref="base.view_country_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="before">
|
||||
<field name="sequence" widget="handle"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!--目录Form-->
|
||||
<record id="view_country_form" model="ir.ui.view">
|
||||
<field name="name">app.res.country.form</field>
|
||||
<field name="model">res.country</field>
|
||||
<field name="inherit_id" ref="base.view_country_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="sequence" widget="handle"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!--搜索Form-->
|
||||
</data>
|
||||
</openerp>
|
||||
8
app_base_chinese/views/templates.xml
Normal file
8
app_base_chinese/views/templates.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="_assets_backend" name="app_base_chinese assets backend" inherit_id="web.assets_backend">
|
||||
<xpath expr="//link[last()]" position="after">
|
||||
<link rel="stylesheet" type="text/scss" href="/app_base_chinese/static/src/scss/app_style.scss"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user