-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathproduct_brand_view.xml
211 lines (211 loc) · 8.81 KB
/
product_brand_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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="product_brand_search_form_view" model="ir.ui.view">
<field name="name">product.brand.search.form</field>
<field name="model">product.brand</field>
<field name="arch" type="xml">
<search string="Product Brand">
<field name="name" />
<field name="partner_id" />
</search>
</field>
</record>
<record id="action_open_brand_products" model="ir.actions.act_window">
<field name="name">Brand Products</field>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,form,tree</field>
<field name="domain">[('product_brand_id', '=', active_id)]</field>
</record>
<record id="action_open_single_product_brand" model="ir.actions.act_window">
<field name="name">Product Brand</field>
<field name="res_model">product.brand</field>
<field name="view_mode">kanban,form,tree</field>
<field name="target">current</field>
<field name="domain">[('product_ids', 'in', active_id)]</field>
</record>
<record id="view_product_brand_form" model="ir.ui.view">
<field name="name">product.brand.form</field>
<field name="model">product.brand</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button
name="%(action_open_brand_products)d"
type="action"
class="oe_stat_button"
icon="fa-cubes"
>
<field
name="products_count"
widget="statinfo"
string="Products"
context="{'default_product_brand_id': active_id}"
/>
</button>
</div>
<field name="logo" widget="image" class="oe_avatar" />
<div class="oe_title">
<label for="name" string="Brand Name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
</div>
<group name="main">
<group name="partner">
<field name="partner_id" />
</group>
</group>
<notebook>
<page name="description" string="Description">
<field name="description" nolabel="1" />
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_product_brand_tree" model="ir.ui.view">
<field name="name">product.brand.tree</field>
<field name="model">product.brand</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="description" />
<field name="partner_id" />
</tree>
</field>
</record>
<record id="view_product_brand_kanban" model="ir.ui.view">
<field name="name">product.brand.kanban</field>
<field name="model">product.brand</field>
<field name="arch" type="xml">
<kanban>
<field name="id" />
<field name="logo" />
<field name="products_count" />
<field name="description" />
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img
t-att-src="kanban_image('product.brand', 'logo', record.id.raw_value)"
alt="Logo"
/>
</div>
<div class="oe_kanban_details">
<h4>
<field name="name" />
</h4>
<div>
<a
name="%(product_brand.action_open_brand_products)d"
type="action"
>
<t t-esc="record.products_count.value" />
Products
</a>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_product_template_search_brand" model="ir.ui.view">
<field name="name">product.template.search.brand</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="product_brand_id" />
<filter
string="Brand"
name="groupby_brand"
domain="[]"
context="{'group_by' : 'product_brand_id'}"
/>
<separator />
</field>
</field>
</record>
<record id="product_template_form_brand_add" model="ir.ui.view">
<field name="name">product.template.product.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<field name="sale_ok" position="before">
<field name="product_brand_id" placeholder="Brand" />
<div />
</field>
</field>
</record>
<record id="view_product_template_kanban_brand" model="ir.ui.view">
<field name="name">product kanban view: add brand</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_kanban_view" />
<field name="arch" type="xml">
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="after">
<div>
<a
t-if="record.product_brand_id"
type="action"
name="%(action_open_single_product_brand)d"
>
<field name="product_brand_id" />
</a>
</div>
</xpath>
</field>
</record>
<record id="view_product_variant_kanban_brand" model="ir.ui.view">
<field name="name">product variant kanban view: add brand</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_kanban_view" />
<field name="arch" type="xml">
<xpath
expr="//div[hasclass('oe_kanban_details')]/strong[1]"
position="after"
>
<div>
<a t-if="record.product_brand_id" type="open">
<field name="product_brand_id" />
</a>
</div>
</xpath>
</field>
</record>
<record id="view_product_template_tree_brand" model="ir.ui.view">
<field name="name">product tree view: add brand</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="product_brand_id" />
</field>
</field>
</record>
<record id="view_product_variant_tree_brand" model="ir.ui.view">
<field name="name">product variant tree view: add brand</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="product_brand_id" />
</field>
</field>
</record>
<record model="ir.actions.act_window" id="action_product_brand">
<field name="name">Brand</field>
<field name="res_model">product.brand</field>
<field name="view_mode">kanban,form,tree</field>
</record>
<menuitem
name="Product Brands"
id="menu_product_brand"
action="action_product_brand"
parent="sale.prod_config_main"
/>
</odoo>