OCA-git-bot
5 years ago
committed by
Pedro M. Baeza
12 changed files with 299 additions and 332 deletions
-
51base_location/__manifest__.py
-
12base_location/demo/res_city_zip.xml
-
17base_location/models/res_city.py
-
22base_location/models/res_city_zip.py
-
64base_location/models/res_company.py
-
74base_location/models/res_partner.py
-
254base_location/tests/test_base_location.py
-
39base_location/views/res_city_view.xml
-
26base_location/views/res_city_zip_view.xml
-
22base_location/views/res_company_view.xml
-
17base_location/views/res_country_view.xml
-
33base_location/views/res_partner_view.xml
@ -1,13 +1,11 @@ |
|||
<?xml version = "1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
|
|||
<record id="demo_brussels_city" model="res.city"> |
|||
<field name="name">Brussels</field> |
|||
<field name="country_id" ref="base.be"/> |
|||
<field name="name">Brussels</field> |
|||
<field name="country_id" ref="base.be" /> |
|||
</record> |
|||
|
|||
<record id="demo_brussels_zip" model="res.city.zip"> |
|||
<field name="name">1000</field> |
|||
<field name="city_id" ref="demo_brussels_city"/> |
|||
<field name="name">1000</field> |
|||
<field name="city_id" ref="demo_brussels_city" /> |
|||
</record> |
|||
</odoo> |
@ -1,62 +1,59 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
|
|||
<record id="view_city_tree_inherit" model="ir.ui.view"> |
|||
<field name="model">res.city</field> |
|||
<field name="inherit_id" ref="base_address_city.view_city_tree"/> |
|||
<field name="inherit_id" ref="base_address_city.view_city_tree" /> |
|||
<field name="arch" type="xml"> |
|||
<tree position="attributes"> |
|||
<attribute name="editable"/> |
|||
<attribute name="editable" /> |
|||
</tree> |
|||
<field name="zipcode" position="attributes"> |
|||
<attribute name="invisible">1</attribute> |
|||
</field> |
|||
<field name="zipcode" position="after"> |
|||
<field name="zip_ids" widget="many2many_tags"/> |
|||
<field name="zip_ids" widget="many2many_tags" /> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_city_form" model="ir.ui.view"> |
|||
<field name="model">res.city</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="country_id"/> |
|||
<field name="state_id"/> |
|||
<field name="name" /> |
|||
<field name="country_id" /> |
|||
<field name="state_id" /> |
|||
</group> |
|||
<notebook> |
|||
<page name="zips" string="Zips"> |
|||
<field name="zip_ids"/> |
|||
<field name="zip_ids" /> |
|||
</page> |
|||
</notebook> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_res_city_full" model="ir.actions.act_window"> |
|||
<field name="name">Cities</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">res.city</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_ids" |
|||
eval="[(5,0,0), |
|||
<field |
|||
name="view_ids" |
|||
eval="[(5,0,0), |
|||
(0, 0, {'view_mode': 'tree', 'view_id': ref('base_address_city.view_city_tree')}), |
|||
(0, 0, {'view_mode': 'form', 'view_id': ref('view_city_form')})]"/> |
|||
(0, 0, {'view_mode': 'form', 'view_id': ref('view_city_form')})]" |
|||
/> |
|||
<field name="help"> |
|||
Display and manage the list of all cities that can be assigned to |
|||
your partner records. Note that an option can be set on each country separately |
|||
to enforce any address of it to have a city in this list. |
|||
</field> |
|||
</record> |
|||
|
|||
<menuitem |
|||
name="Cities" |
|||
id="locations_menu_cities" |
|||
parent="contacts.menu_localisation" |
|||
action="action_res_city_full" |
|||
sequence="4" |
|||
name="Cities" |
|||
id="locations_menu_cities" |
|||
parent="contacts.menu_localisation" |
|||
action="action_res_city_full" |
|||
sequence="4" |
|||
/> |
|||
|
|||
</odoo> |
@ -1,55 +1,49 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
|
|||
<record model="ir.ui.view" id="city_zip_form"> |
|||
<field name="name">res.city.zip.form</field> |
|||
<field name="model">res.city.zip</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Zip"> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="city_id"/> |
|||
<field name="name" /> |
|||
<field name="city_id" /> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="city_zip_tree"> |
|||
<field name="name">res.city.zip.tree</field> |
|||
<field name="model">res.city.zip</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Zips" editable="top"> |
|||
<field name="name"/> |
|||
<field name="city_id"/> |
|||
<field name="name" /> |
|||
<field name="city_id" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_city_zip_filter" model="ir.ui.view"> |
|||
<field name="name">res.city.zip.select</field> |
|||
<field name="model">res.city.zip</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search zip"> |
|||
<field name="name"/> |
|||
<field name="city_id"/> |
|||
<field name="name" /> |
|||
<field name="city_id" /> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_zip_tree" model="ir.actions.act_window"> |
|||
<field name="name">Locations</field> |
|||
<field name="res_model">res.city.zip</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field ref="city_zip_tree" name="view_id"/> |
|||
<field name="search_view_id" ref="view_city_zip_filter"/> |
|||
<field ref="city_zip_tree" name="view_id" /> |
|||
<field name="search_view_id" ref="view_city_zip_filter" /> |
|||
</record> |
|||
|
|||
<menuitem |
|||
name="Zips" |
|||
id="locations_menu_zips" |
|||
parent="contacts.menu_localisation" |
|||
action="action_zip_tree" |
|||
sequence="5" |
|||
/> |
|||
|
|||
/> |
|||
</odoo> |
@ -1,31 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
|
|||
<record id="view_country_search" model="ir.ui.view"> |
|||
<field name="name">res.country.search</field> |
|||
<field name="model">res.country</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Country"> |
|||
<field name="name"/> |
|||
<field name="code"/> |
|||
<field name="name" /> |
|||
<field name="code" /> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_res_country_city_better_zip_form" model="ir.ui.view"> |
|||
<field name="model">res.country</field> |
|||
<field name="inherit_id" ref="base.view_country_form"/> |
|||
<field name="inherit_id" ref="base.view_country_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[hasclass('oe_button_box')]" position="inside"> |
|||
<button name="%(action_zip_tree)d" |
|||
<button |
|||
name="%(action_zip_tree)d" |
|||
class="oe_stat_button" |
|||
icon="fa-globe" |
|||
type="action" |
|||
context="{'default_country_id': active_id, 'search_default_country_id': active_id}" |
|||
string="Zips"> |
|||
string="Zips" |
|||
> |
|||
</button> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,25 +1,30 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<record id="view_partner_form" model="ir.ui.view"> |
|||
<field name="name">res.partner.zip_id.2</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="inherit_id" ref="base.view_partner_form" /> |
|||
<field name="arch" type="xml"> |
|||
<field name="city" position="before"> |
|||
<field name="zip_id" |
|||
options="{'create_name_field': 'city', 'no_open': True, 'no_create': True}" |
|||
placeholder="Location completion" |
|||
class="oe_edit_only" |
|||
attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/> |
|||
<field |
|||
name="zip_id" |
|||
options="{'create_name_field': 'city', 'no_open': True, 'no_create': True}" |
|||
placeholder="Location completion" |
|||
class="oe_edit_only" |
|||
attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" |
|||
/> |
|||
</field> |
|||
<xpath expr="//field[@name='child_ids']/form//field[@name='city']" |
|||
position="before"> |
|||
<field name="zip_id" |
|||
options="{'create_name_field': 'city', 'no_open': True, 'no_create': True}" |
|||
placeholder="City completion" |
|||
class="oe_edit_only"/> |
|||
<xpath |
|||
expr="//field[@name='child_ids']/form//field[@name='city']" |
|||
position="before" |
|||
> |
|||
<field |
|||
name="zip_id" |
|||
options="{'create_name_field': 'city', 'no_open': True, 'no_create': True}" |
|||
placeholder="City completion" |
|||
class="oe_edit_only" |
|||
/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue