partner-contact/base_location_nuts/views/res_partner_view.xml

91 lines
3.6 KiB
XML
Raw Normal View History

2024-10-01 05:51:46 +00:00
<?xml version="1.0" encoding="utf-8" ?>
<flectra>
<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='vat']" position="before">
<field name="allowed_nut_ids" invisible="1" />
<field
name="nuts1_id"
context="{'default_country_id': country_id, 'default_level': 1}"
/>
<field
name="nuts2_id"
context="{'default_country_id': country_id, 'default_level': 2, 'default_parent_id': nuts1_id}"
/>
<field
name="nuts3_id"
context="{'default_country_id': country_id, 'default_level': 3, 'default_parent_id': nuts2_id}"
/>
<field
name="nuts4_id"
context="{'default_country_id': country_id, 'default_level': 4, 'default_parent_id': nuts3_id}"
/>
</xpath>
<xpath
expr="//field[@name='child_ids']/form//field[@name='country_id']/.."
position="after"
>
<field name="allowed_nut_ids" invisible="1" />
<field
name="nuts1_id"
context="{'default_country_id': country_id, 'default_level': 1}"
/>
<field
name="nuts2_id"
context="{'default_country_id': country_id, 'default_level': 2, 'default_parent_id': nuts1_id}"
/>
<field
name="nuts3_id"
context="{'default_country_id': country_id, 'default_level': 3, 'default_parent_id': nuts2_id}"
/>
<field
name="nuts4_id"
context="{'default_country_id': country_id, 'default_level': 4, 'default_parent_id': nuts3_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" />
</field>
<filter name="salesperson" position="after">
<filter
name="nuts_l1"
string="NUTS L1"
domain="[]"
context="{'group_by': 'nuts1_id'}"
/>
<filter
name="nuts_l2"
string="NUTS L2"
domain="[]"
context="{'group_by': 'nuts2_id'}"
/>
<filter
name="nuts_l3"
string="NUTS L3"
domain="[]"
context="{'group_by': 'nuts3_id'}"
/>
<filter
name="nuts_l4"
string="NUTS L4"
domain="[]"
context="{'group_by': 'nuts4_id'}"
/>
</filter>
</field>
</record>
</flectra>