Andrea
5 years ago
committed by
Andrii Skrypka
11 changed files with 381 additions and 354 deletions
-
36base_location_nuts/__manifest__.py
-
2base_location_nuts/migrations/12.0.1.0.0/post-migration.py
-
3base_location_nuts/models/res_country.py
-
83base_location_nuts/models/res_partner.py
-
28base_location_nuts/models/res_partner_nuts.py
-
69base_location_nuts/tests/test_base_location_nuts.py
-
30base_location_nuts/views/res_country_view.xml
-
134base_location_nuts/views/res_partner_nuts_view.xml
-
99base_location_nuts/views/res_partner_view.xml
-
172base_location_nuts/wizard/nuts_import.py
-
79base_location_nuts/wizard/nuts_import_view.xml
@ -1,19 +1,17 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
|
|||
<record id="view_country_form" model="ir.ui.view"> |
|||
<field name="name">NUTS fields</field> |
|||
<field name="model">res.country</field> |
|||
<field name="inherit_id" ref="base.view_country_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="/form"> |
|||
<group name="nuts" string="NUTS"> |
|||
<group> |
|||
<field name="state_level"/> |
|||
<record id="view_country_form" model="ir.ui.view"> |
|||
<field name="name">NUTS fields</field> |
|||
<field name="model">res.country</field> |
|||
<field name="inherit_id" ref="base.view_country_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="/form"> |
|||
<group name="nuts" string="NUTS"> |
|||
<group> |
|||
<field name="state_level" /> |
|||
</group> |
|||
</group> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -1,77 +1,77 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
|
|||
<record id="res_partner_nuts_tree" model="ir.ui.view"> |
|||
<field name="name">NUTS Items tree</field> |
|||
<field name="model">res.partner.nuts</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="NUTS Items"> |
|||
<field name="level"/> |
|||
<field name="code"/> |
|||
<field name="name"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="res_partner_nuts_form" model="ir.ui.view"> |
|||
<field name="name">NUTS Items form</field> |
|||
<field name="model">res.partner.nuts</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="NUTS Item"> |
|||
<group> |
|||
<record id="res_partner_nuts_tree" model="ir.ui.view"> |
|||
<field name="name">NUTS Items tree</field> |
|||
<field name="model">res.partner.nuts</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="NUTS Items"> |
|||
<field name="level" /> |
|||
<field name="code" /> |
|||
<field name="name" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
<record id="res_partner_nuts_form" model="ir.ui.view"> |
|||
<field name="name">NUTS Items form</field> |
|||
<field name="model">res.partner.nuts</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="NUTS Item"> |
|||
<group> |
|||
<field name="level"/> |
|||
<field name="code"/> |
|||
<field name="parent_id"/> |
|||
<field name="name"/> |
|||
<field name="not_updatable"/> |
|||
<group> |
|||
<field name="level" /> |
|||
<field name="code" /> |
|||
<field name="parent_id" /> |
|||
<field name="name" /> |
|||
<field name="not_updatable" /> |
|||
</group> |
|||
<group> |
|||
<field name="country_id" /> |
|||
<field name="state_id" /> |
|||
</group> |
|||
</group> |
|||
<group> |
|||
<field name="country_id"/> |
|||
<field name="state_id"/> |
|||
</group> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="res_partner_nuts_action" model="ir.actions.act_window"> |
|||
<field name="name">NUTS Items</field> |
|||
<field name="res_model">res.partner.nuts</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="help">You must click at import wizard to populate NUTS items |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="res_partner_nuts_action" model="ir.actions.act_window"> |
|||
<field name="name">NUTS Items</field> |
|||
<field name="res_model">res.partner.nuts</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="help">You must click at import wizard to populate NUTS items |
|||
in Odoo database in: |
|||
Sales > Configuration > Address Book > Localization > Import NUTS 2013</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="view_res_partner_nuts_filter"> |
|||
<field name="name">NUTS search filters</field> |
|||
<field name="model">res.partner.nuts</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search NUTS"> |
|||
<field name="name"/> |
|||
<field name="country_id"/> |
|||
<field name="state_id"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter name="country" |
|||
</record> |
|||
<record model="ir.ui.view" id="view_res_partner_nuts_filter"> |
|||
<field name="name">NUTS search filters</field> |
|||
<field name="model">res.partner.nuts</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search NUTS"> |
|||
<field name="name" /> |
|||
<field name="country_id" /> |
|||
<field name="state_id" /> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
name="country" |
|||
string="Country" |
|||
domain="[]" |
|||
context="{'group_by': 'country_id'}"/> |
|||
<filter name="level" |
|||
context="{'group_by': 'country_id'}" |
|||
/> |
|||
<filter |
|||
name="level" |
|||
string="Level" |
|||
domain="[]" |
|||
context="{'group_by': 'level'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<menuitem action="res_partner_nuts_action" |
|||
id="res_partner_nuts_menu" |
|||
groups="base.group_partner_manager" |
|||
name="NUTS Items" |
|||
parent="contacts.menu_localisation" |
|||
sequence="40"/> |
|||
|
|||
context="{'group_by': 'level'}" |
|||
/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<menuitem |
|||
action="res_partner_nuts_action" |
|||
id="res_partner_nuts_menu" |
|||
groups="base.group_partner_manager" |
|||
name="NUTS Items" |
|||
parent="contacts.menu_localisation" |
|||
sequence="40" |
|||
/> |
|||
</odoo> |
@ -1,57 +1,64 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
|
|||
<record model="ir.ui.view" id="view_partner_form_nuts"> |
|||
<field name="name">Partner form with NUTS</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//sheet/group//field[@name='country_id']/.." position="after"> |
|||
<field name="nuts1_id"/> |
|||
<field name="nuts2_id"/> |
|||
<field name="nuts3_id"/> |
|||
<field name="nuts4_id"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='child_ids']/form//field[@name='country_id']/.." position="after"> |
|||
<field name="nuts1_id"/> |
|||
<field name="nuts2_id"/> |
|||
<field name="nuts3_id"/> |
|||
<field name="nuts4_id"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="view_res_partner_filter_nuts"> |
|||
<field name="name">Partner search with NUTS</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_res_partner_filter"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="category_id" position="after"> |
|||
<field name="nuts1_id"/> |
|||
<field name="nuts2_id"/> |
|||
<field name="nuts3_id"/> |
|||
<field name="nuts4_id"/> |
|||
<record model="ir.ui.view" id="view_partner_form_nuts"> |
|||
<field name="name">Partner form with NUTS</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//sheet/group//field[@name='country_id']/.." position="after"> |
|||
<field name="nuts1_id" /> |
|||
<field name="nuts2_id" /> |
|||
<field name="nuts3_id" /> |
|||
<field name="nuts4_id" /> |
|||
</xpath> |
|||
<xpath |
|||
expr="//field[@name='child_ids']/form//field[@name='country_id']/.." |
|||
position="after" |
|||
> |
|||
<field name="nuts1_id" /> |
|||
<field name="nuts2_id" /> |
|||
<field name="nuts3_id" /> |
|||
<field name="nuts4_id" /> |
|||
</xpath> |
|||
</field> |
|||
<filter name="salesperson" position="after"> |
|||
<filter name="nuts_l1" |
|||
</record> |
|||
<record model="ir.ui.view" id="view_res_partner_filter_nuts"> |
|||
<field name="name">Partner search with NUTS</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_res_partner_filter" /> |
|||
<field name="arch" type="xml"> |
|||
<field name="category_id" position="after"> |
|||
<field name="nuts1_id" /> |
|||
<field name="nuts2_id" /> |
|||
<field name="nuts3_id" /> |
|||
<field name="nuts4_id" /> |
|||
</field> |
|||
<filter name="salesperson" position="after"> |
|||
<filter |
|||
name="nuts_l1" |
|||
string="NUTS L1" |
|||
domain="[]" |
|||
context="{'group_by': 'nuts1_id'}"/> |
|||
<filter name="nuts_l2" |
|||
context="{'group_by': 'nuts1_id'}" |
|||
/> |
|||
<filter |
|||
name="nuts_l2" |
|||
string="NUTS L2" |
|||
domain="[]" |
|||
context="{'group_by': 'nuts2_id'}"/> |
|||
<filter name="nuts_l3" |
|||
context="{'group_by': 'nuts2_id'}" |
|||
/> |
|||
<filter |
|||
name="nuts_l3" |
|||
string="NUTS L3" |
|||
domain="[]" |
|||
context="{'group_by': 'nuts3_id'}"/> |
|||
<filter name="nuts_l4" |
|||
context="{'group_by': 'nuts3_id'}" |
|||
/> |
|||
<filter |
|||
name="nuts_l4" |
|||
string="NUTS L4" |
|||
domain="[]" |
|||
context="{'group_by': 'nuts4_id'}"/> |
|||
</filter> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
context="{'group_by': 'nuts4_id'}" |
|||
/> |
|||
</filter> |
|||
</field> |
|||
</record> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue