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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_product_view_search" model="ir.ui.view">
<field name="name">lunch.product.search</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<search string="Product Search">
<field name="name" string="Product"/>
<field name="category_id" string="Category"/>
<field name="supplier_id"/>
<field name="description"/>
<separator/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/>
<filter name="group_by_category" string="Category" context="{'group_by': 'category_id'}"/>
</group>
<searchpanel>
<field name="category_id" select="multi" string="Categories" icon="fa-cutlery" color="#875A7B" enable_counters="1"/>
<field name="supplier_id" select="multi" string="Vendors" icon="fa-truck" enable_counters="1"/>
</searchpanel>
</search>
</field>
</record>
<record id="lunch_product_report_view_search" model="ir.ui.view">
<field name="name">lunch.product.report.search</field>
<field name="model">lunch.product.report</field>
<field name="arch" type="xml">
<search string="Product Search">
<field name="name" string="Product"/>
<field name="category_id" string="Category"/>
<field name="supplier_id"/>
<field name="description"/>
<group expand="0" string="Group By">
<filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/>
<filter name="group_by_category" string="Category" context="{'group_by': 'category_id'}"/>
</group>
<searchpanel>
<field name="category_id" select="multi" string="Categories" icon="fa-cutlery" color="#875A7B"/>
<field name="supplier_id" select="multi" string="Vendors" icon="fa-truck"/>
</searchpanel>
</search>
</field>
</record>
<record id="lunch_product_view_tree" model="ir.ui.view">
<field name="name">lunch.product.tree</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<tree string="Products Tree">
<field name="currency_id" invisible="1"/>
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="description"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</record>
<record id="lunch_product_view_form" model="ir.ui.view">
<field name="name">lunch.product.form</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<form string="Products Form">
<field name="currency_id" invisible="1"/>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name" class="oe-edit-only"/>
<h1>
<field name='name'/>
</h1>
</div>
<group>
<group>
<field name="active" invisible="1"/>
<field name='category_id'/>
<field name='supplier_id'/>
<field name='price' widget="monetary"/>
</group>
<group>
<field name="new_until"/>
<field name='description'/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="lunch_product_report_view_tree" model="ir.ui.view">
<field name="name">lunch.product.tree</field>
<field name="model">lunch.product.report</field>
<field name="priority">999</field>
<field name="arch" type="xml">
<tree js_class="lunch_list">
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="description"/>
<field name="product_id" invisible="1"/>
<field name="price" widget="monetary"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="view_lunch_product_kanban_order" model="ir.ui.view">
<field name="name">lunch.product.kanban</field>
<field name="model">lunch.product.report</field>
<field name="priority">999</field>
<field name="arch" type="xml">
<kanban js_class="lunch_kanban" create="0" edit="0" group_create="0" class="o_kanban_mobile">
<field name="id"/>
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="description"/>
<field name="currency_id"/>
<field name="user_id"/>
<field name="product_id"/>
<field name="is_new"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
<field name="image_128" class="o_lunch_image o_kanban_image_fill_left d-none d-md-block" options="{'placeholder': '/lunch/static/img/lunch.png', 'size': [94, 94]}" widget="image"/>
<div class="oe_kanban_details ml8">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<div>
<span class="pr-1"><field name="is_favorite" widget="boolean_favorite" nolabel="1"/></span>
<div class="float-right o_lunch_purple">
<field name="price" widget="monetary"/>
</div>
<div t-if="record.is_new.raw_value" class="float-right o_lunch_new_product mr-1 badge-pill badge-success">
New
</div>
<strong><span t-esc="record.name.value"/></strong>
</div>
</strong>
<span class="o_kanban_record_subtitle"><span t-esc="record.supplier_id.value"/></span>
</div>
</div>
<div class="o_kanban_record_bottom">
<ul>
<li t-esc="record.description.value" class="text-muted"/>
</ul>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_lunch_product_kanban" model="ir.ui.view">
<field name="name">lunch.product.kanban</field>
<field name="model">lunch.product</field>
<field name="priority">5</field>
<field name="arch" type="xml">
<kanban create="1" edit="0" class="o_kanban_mobile">
<field name="id"/>
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="description"/>
<field name="currency_id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
<div class="o_kanban_image_fill_left d-none d-md-block"
t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_128', record.id.raw_value)}')"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<div>
<div class="float-right">
<field name="price" widget="monetary"/>
</div>
<strong><span t-esc="record.name.value"/></strong>
</div>
</strong>
<span class="o_kanban_record_subtitle"><span t-esc="record.supplier_id.value"/></span>
</div>
</div>
<div class="o_kanban_record_bottom">
<ul>
<li t-esc="record.description.value" class="text-muted"/>
</ul>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_product_action_statbutton" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">lunch.product</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_group_by_supplier': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product for lunch
</p><p>
A product is defined by its name, category, price and vendor.
</p>
</field>
</record>
<record id="lunch_product_category_view_tree" model="ir.ui.view">
<field name="name">Product category Tree</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<tree string="Products List">
<field name='name' string="Product Category"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="lunch_product_category_view_form" model="ir.ui.view">
<field name="name">Product category Form</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<form string="Product Categories Form">
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" type="action" name="%(lunch.lunch_product_action_statbutton)d"
context="{'search_default_category_id': active_id,'default_category_id': active_id}"
attrs="{'invisible': [('product_count', '=', 0)]}"
icon="fa-cutlery">
<field string="Products" name="product_count" widget="statinfo"/>
</button>
</div>
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name" class="oe-edit-only"/>
<h1>
<field name="name"/>
</h1>
</div>
<label for="company_id" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<group>
<group>
<field name="active" invisible="1"/>
<field name="topping_label_1"/>
<field name="topping_quantity_1"/>
</group>
<div>
<field name="topping_ids_1" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="currency_id" invisible="1"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</div>
<group>
<field name="topping_label_2"/>
<field name="topping_quantity_2"/>
</group>
<div>
<field name="topping_ids_2" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="currency_id" invisible="1"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</div>
<group>
<field name="topping_label_3"/>
<field name="topping_quantity_3"/>
</group>
<div>
<field name="topping_ids_3" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="currency_id" invisible="1"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</div>
</group>
</sheet>
</form>
</field>
</record>
<record id="lunch_product_category_view_kanban" model="ir.ui.view">
<field name="name">Product category Kanban</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
<div class="o_kanban_image_fill_left d-none d-md-block"
t-attf-style="background-image:url('#{kanban_image('lunch.product.category', 'image_128', record.id.raw_value)}')"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<div class="float-right">
<button class="badge badge-primary" type="action"
name="%(lunch.lunch_product_action_statbutton)d"
context="{'search_default_category_id': active_id,'default_category_id': active_id}"
attrs="{'invisible': [('product_count', '=', 0)]}">
<field string="Products" name="product_count" widget="statinfo"/>
</button>
</div>
</div>
</div>
<div class="o_kanban_record_body">
<strong><field name="name"/></strong><br/>
<field name="company_id" groups="base.group_multi_company"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_product_category_view_search" model="ir.ui.view">
<field name="name">lunch.product.category.search</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<record id="lunch_product_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">lunch.product</field>
<field name="view_mode">tree,kanban,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product for lunch
</p><p>
A product is defined by its name, category, price and vendor.
</p>
</field>
</record>
<record id="lunch_product_action_order" model="ir.actions.act_window">
<field name="name">Order Your Lunch</field>
<field name="res_model">lunch.product.report</field>
<field name="view_mode">kanban,tree</field>
<field name="view_id" ref="view_lunch_product_kanban_order"/>
<field name="search_view_id" ref="lunch_product_report_view_search"/>
<field name="domain">[('supplier_id.available_today', '=', True), '|', ('user_id', '=', False), ('user_id', '=', uid)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
There is no product available today
</p><p>
To see some products, check if your vendors are available today and that you have configured some products
</p>
</field>
</record>
<record id="lunch_product_category_action" model="ir.actions.act_window">
<field name="name">Product Categories</field>
<field name="res_model">lunch.product.category</field>
<field name="view_mode">tree,form,kanban</field>
<field name="search_view_id" ref="lunch_product_category_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product category
</p><p>
Here you can access all categories for the lunch products.
</p>
</field>
</record>
</odoo>
|