forked from OCA/delivery-carrier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelivery_carrier_view.xml
95 lines (95 loc) · 4.13 KB
/
delivery_carrier_view.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016-2020 Tecnativa - Pedro M. Baeza
Copyright 2017 Tecnativa - Luis M. Ontalba
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_delivery_carrier_form" model="ir.ui.view">
<field name="model">delivery.carrier</field>
<field name="inherit_id" ref="delivery.view_delivery_carrier_form" />
<field name="arch" type="xml">
<div name="title" position="after">
<group name="group_destination_type">
<field
name="destination_type"
invisible="context.get('show_children_fields', False)"
/>
</group>
</div>
<group name="provider_details" position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '=', 'multi')]}</attribute>
</group>
<label for="margin" position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '=', 'multi')]}</attribute>
</label>
<xpath expr="//field[@name='margin']/.." position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '=', 'multi')]}</attribute>
</xpath>
<xpath expr="//field[@name='free_over']/.." position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '=', 'multi')]}</attribute>
</xpath>
<field name="amount" position="attributes">
<attribute
name="attrs"
>{'required':[('free_over','!=', False)], 'invisible':['|', ('free_over','=', False), ('destination_type', '=', 'multi')]}</attribute>
</field>
<page name="pricing" position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '=', 'multi')]}</attribute>
</page>
<page name="destination" position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '=', 'multi')]}</attribute>
</page>
<notebook position="inside">
<page
string="Destinations"
name="page_multi_destination"
attrs="{'invisible': [('destination_type', '!=', 'multi')]}"
>
<field name="child_ids" context="{'show_children_fields': True}" />
</page>
</notebook>
</field>
</record>
<record id="view_delivery_carrier_tree" model="ir.ui.view">
<field name="model">delivery.carrier</field>
<field name="inherit_id" ref="delivery.view_delivery_carrier_tree" />
<field name="arch" type="xml">
<field name="delivery_type" position="attributes">
<attribute
name="attrs"
>{'invisible': [('destination_type', '!=', 'one')]}</attribute>
</field>
<field name="delivery_type" position="after">
<field name="destination_type" />
<field
name="country_ids"
invisible="not context.get('show_children_fields', False)"
/>
<field
name="state_ids"
invisible="not context.get('show_children_fields', False)"
/>
<field
name="zip_prefix_ids"
widget="many2many_tags"
invisible="not context.get('show_children_fields', False)"
/>
</field>
</field>
</record>
<record id="delivery.action_delivery_carrier_form" model="ir.actions.act_window">
<field name="domain">[('parent_id', '=', False)]</field>
<field name="context">{'show_children_carriers': True}</field>
</record>
</odoo>