forked from OCA/product-attribute
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproduct_brand_view.xml
More file actions
239 lines (225 loc) · 10.3 KB
/
product_brand_view.xml
File metadata and controls
239 lines (225 loc) · 10.3 KB
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?xml version="1.0" encoding="utf-8"?>
<!--
product_brand for Odoo
Copyright (C) 2009 NetAndCo <http://www.netandco.net>.
Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>
Copyright (C) 2014 prisnet.ch Seraphine Lantible <s.lantible@gmail.com>
Copyright (C) 2015 Leonardo Donelli <http://www.wearemonk.com>
Contributors:
Mathieu Lemercier <mathieu@netandco.net>
Franck Bret <franck@netandco.net>
Seraphine Lantible <s.lantible@gmail.com>
Leonardo Donelli <donelli@webmonks.it>
-->
<openerp>
<data>
<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>
<act_window
id="action_open_brand_products"
name="Brand Products"
res_model="product.template"
view_type="form"
view_mode="kanban,form,tree"
domain="[('product_brand_id', '=', active_id)]"/>
<act_window
id="action_open_single_product_brand"
name="Product Brand"
res_model="product.brand"
view_type="form"
view_mode="kanban,form,tree"
target="current"
domain="[('product_ids', 'in', active_id)]"/>
<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 string="Product Brand" version="7.0">
<sheet>
<field name="logo" widget="image" class="oe_avatar oe_left"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Brand Name"/>
</div>
<h1>
<field name="name"/>
</h1>
</div>
<div class="oe_right oe_button_box">
<button
class="oe_inline oe_stat_button"
type="action"
name="%(action_open_brand_products)d"
icon="fa-cubes">
<field name="products_count" string="Products" widget="statinfo" />
</button>
</div>
<group>
<field name="partner_id"/>
</group>
<group string="Description">
<field name="description" nolabel="1"/>
</group>
</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 string="product.brand">
<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="logo"/>
<field name="products_count"/>
<field name="description"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override">
<a type="open">
<img t-att-src="kanban_image('product.product', 'logo', record.id.value)"
class="oe_kanban_image"/>
</a>
<div class="oe_kanban_details">
<h4>
<a type="open">
<field name="name"/>
</a>
</h4>
<div>
<a name="%(product_brand.action_open_brand_products)d"
type="action">
<t t-esc="record.products_count.value"/> Products
</a>
</div>
<span>
<t t-esc="record.description.value.substr(0,200)"/>
<t t-if="record.description.value.length > 200">
<a type="open"><b>...</b></a>
</t>
</span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="product_search_form_view" model="ir.ui.view">
<field name="name">product.search.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<field name="categ_id" position="after">
<field name="product_brand_id"/>
</field>
<group string='Group by...' position="inside">
<filter string="Brand" name="groupby_brand" domain="[]"
context="{'group_by' : 'product_brand_id'}"/>
</group>
</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"/>
</field>
<group string='Group by...' position="inside">
<filter string="Brand" name="groupby_brand" domain="[]"
context="{'group_by' : 'product_brand_id'}"/>
</group>
</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="name" position="after" >
<field name="product_brand_id" placeholder="Brand"/>
</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="//h4" 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="//h4" 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_type">form</field>
<field name="view_mode">kanban,form,tree</field>
</record>
<menuitem
name="Product Brands"
id="menu_product_brand"
action="action_product_brand"
parent="base.menu_product"/>
</data>
</openerp>