update chinese city base

This commit is contained in:
ivan deng
2020-01-11 21:28:08 +08:00
parent 28a5ef67d2
commit 4a3419706f
9 changed files with 91 additions and 12 deletions

View File

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

View File

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

View File

@@ -4,6 +4,7 @@ from . import res_partner
from . import res_currency
from . import product_category
from . import stock_location
from . import res_country

View 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)

View 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;
}
}

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

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

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" name="app_web_fullwidth asset" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/scss" href="/app_web_fullwidth/static/src/scss/style.scss"/>
</xpath>
</template>
</data>
<data>
<template id="assets_backend" name="app_web_fullwidth asset" inherit_id="web.assets_backend">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/app_web_fullwidth/static/src/scss/style.scss"/>
</xpath>
</template>
</data>
</odoo>

View File

@@ -42,5 +42,5 @@
'templates/assets.xml',
],
'installable': True,
'auto_install': True,
'auto_install': False,
}