5 <menuitem id='menu_lunch' name='Lunch' sequence="100" groups="group_lunch_user"/>
6 <menuitem name="Lunch" parent="menu_lunch" id="menu_lunch_title" sequence="50" />
7 <menuitem name="Administrate Orders" parent="menu_lunch" id="menu_lunch_admin" sequence="51" groups="group_lunch_manager"/>
8 <menuitem name="Administrate Cash Moves" parent="menu_lunch" id="menu_lunch_cash" sequence="52" groups="group_lunch_manager"/>
9 <menuitem name="Configuration" parent="menu_lunch" id="menu_lunch_config" sequence="53" groups="group_lunch_manager"/>
11 <!--View Search to group/filter by Supplier and time-->
12 <record model="ir.ui.view" id="lunch_order_line_search_view">
13 <field name="name">Search</field>
14 <field name="model">lunch.order.line</field>
15 <field name="arch" type="xml">
16 <search string="Search">
17 <field name="name" filter_domain="['|', ('name', 'ilike', self), ('note', 'ilike', self)]"/>
18 <filter name="not_confirmed" string="Not Received" domain="[('state','!=',('confirmed'))]"/>
19 <filter name="comfirmed" string="Received" domain="[('state','=','confirmed')]"/>
20 <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
22 <filter name="today" string="Today" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
23 <field name="user_id"/>
24 <group expand="0" string="Group By...">
25 <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
26 <filter name="group_by_date" string="By Date" context="{'group_by':'date'}"/>
32 <!--View Search to group by employee and input/output (cashmoves)-->
33 <record id="view_lunch_employee_payment_filter" model="ir.ui.view">
34 <field name='name'>lunch employee payment</field>
35 <field name='model'>lunch.cashmove</field>
36 <field name='arch' type='xml'>
37 <search string="lunch employee payment">
38 <field name="description"/>
39 <field name="user_id"/>
40 <filter name='is_payment' string="Payment" domain="[('state','=','payment')]"/>
42 <filter name='is_mine' string="My Account" domain="[('user_id','=',uid)]"/>
47 <record id="view_lunch_cashmove_filter" model="ir.ui.view">
48 <field name='name'>lunch cashmove</field>
49 <field name='model'>lunch.cashmove</field>
50 <field name='arch' type='xml'>
51 <search string="lunch cashmove">
52 <field name="description"/>
53 <field name="user_id"/>
54 <group expand="0" string="Group By...">
55 <filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
61 <!--View search for order-->
62 <record id="view_search_my_order" model="ir.ui.view">
63 <field name='name'>lunch orders</field>
64 <field name='model'>lunch.order</field>
65 <field name='arch' type='xml'>
66 <search string="lunch orders">
68 <field name="order_line_ids"/>
69 <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
75 <record model="ir.ui.view" id="alert_search_view">
76 <field name="name">Search</field>
77 <field name="model">lunch.alert</field>
78 <field name="arch" type="xml">
79 <search string="Search">
80 <field name="message"/>
85 <!--Action for Your Orders-->
86 <record model="ir.actions.act_window" id="action_lunch_order_form">
87 <field name="name">New Order</field>
88 <field name="res_model">lunch.order</field>
89 <field name="view_mode">form</field>
91 <menuitem name="New Order" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
93 <record model="ir.actions.act_window" id="action_lunch_order_tree">
94 <field name="name">Your Orders</field>
95 <field name="res_model">lunch.order</field>
96 <field name="view_mode">tree,form</field>
97 <field name="search_view_id" ref="view_search_my_order"/>
98 <field name="context">{"search_default_is_mine":1}</field>
99 <field name="help" type="html">
100 <p class="oe_view_nocontent_create">
101 Click to create a lunch order.
104 A lunch order is defined by its user, date and order lines.
105 Each order line corresponds to a product, an additional note and a price.
106 Before selecting your order lines, don't forget to read the warnings displayed in the reddish area.
110 <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
112 <!--Action for Lunch cashmoves-->
113 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
114 <field name="name">Your Account</field>
115 <field name="res_model">lunch.cashmove</field>
116 <field name="view_mode">tree</field>
117 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
118 <field name="context">{"search_default_is_mine":1}</field>
119 <field name="help" type="html">
121 Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
122 An expense is automatically created when an order is received while a payment is a reimbursement to the company encoded by the manager.
126 <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
128 <!--Action for Administrate Orders group by supplier-->
129 <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
130 <field name="name">Orders by Supplier</field>
131 <field name="res_model">lunch.order.line</field>
132 <field name="view_mode">tree</field>
133 <field name="search_view_id" ref="lunch_order_line_search_view"/>
134 <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
135 <field name="help" type="html">
137 Here you can see today's orders grouped by suppliers.
140 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
141 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
142 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> to announce that the order isn't available
146 <menuitem name="Today's Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_order_by_supplier_form" action="action_lunch_order_by_supplier_form" />
148 <!--Action for control Supplier-->
149 <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
150 <field name="name">Control Suppliers</field>
151 <field name="res_model">lunch.order.line</field>
152 <field name="view_mode">tree</field>
153 <field name="search_view_id" ref="lunch_order_line_search_view"/>
154 <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
155 <field name="help" type="html">
157 Here you can see every orders grouped by suppliers and by date.
160 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
161 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
162 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> red X to announce that the order isn't available
166 <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
168 <!--Action for Control Accounts-->
169 <record model="ir.actions.act_window" id="action_lunch_control_accounts">
170 <field name="name">Control Accounts</field>
171 <field name="res_model">lunch.cashmove</field>
172 <field name="view_mode">tree,form</field>
173 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
174 <field name="context">{"search_default_group_by_user":1}</field>
175 <field name="help" type="html">
176 <p class="oe_view_nocontent_create">
177 Click to create a new payment.
180 A cashmove can either be an expense or a payment.<br/>
181 An expense is automatically created at the order receipt.<br/>
182 A payment represents the employee reimbursement to the company.
186 <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
189 <!--Action for Payment cashmove-->
190 <record model="ir.actions.act_window" id="action_lunch_cashmove">
191 <field name="name">Register Cash Moves</field>
192 <field name="res_model">lunch.cashmove</field>
193 <field name="view_mode">tree,form</field>
194 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
195 <field name="context">{"search_default_is_payment":1}</field>
196 <field name="help" type="html">
197 <p class="oe_view_nocontent_create">
198 Click to create a payment.
201 Here you can see the employees' payment. A payment is a cash move from the employee to the company.
205 <menuitem name="Employee's Payment" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
207 <!--Action for Products-->
208 <record model="ir.actions.act_window" id="action_lunch_products">
209 <field name="name">Products</field>
210 <field name="res_model">lunch.product</field>
211 <field name="view_mode">tree,form</field>
212 <field name="help" type="html">
213 <p class="oe_view_nocontent_create">
214 Click to create a product for lunch.
217 A product is defined by its name, category, price and supplier.
221 <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
223 <!--Action for Product categories-->
224 <record model="ir.actions.act_window" id="action_lunch_product_categories">
225 <field name="name">Product Categories</field>
226 <field name="res_model">lunch.product.category</field>
227 <field name="view_mode">tree,form</field>
228 <field name="help" type="html">
229 <p class="oe_view_nocontent_create">
230 Click to create a lunch category.
233 Here you can find every lunch categories for products.
238 <record model="ir.ui.view" id="product_category_form_view">
239 <field name="name">Product category Form</field>
240 <field name="model">lunch.product.category</field>
241 <field name="arch" type="xml">
242 <form string="Products Form" version="7.0">
245 <field name='name' string="Product Category: "/>
252 <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
254 <!--Action for Alert-->
255 <record model="ir.actions.act_window" id="action_lunch_alert">
256 <field name="name">Alerts</field>
257 <field name="res_model">lunch.alert</field>
258 <field name="view_mode">tree,form</field>
259 <field name="search_view_id" ref="alert_search_view"/>
260 <field name="help" type="html">
261 <p class="oe_view_nocontent_create">
262 Click to create a lunch alert.
265 Alerts are used to warn employee from possible issues concerning the lunch orders.
266 To create a lunch alert you have to define its recurrency, the time interval during which the alert should be executed and the message to display.
270 - Recurency: Everyday<br/>
271 - Time interval: from 00h00 am to 11h59 pm<br/>
272 - Message: "You must order before 10h30 am"
276 <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
278 <!--View for Order lines-->
279 <record model="ir.ui.view" id="orders_order_lines_tree_view">
280 <field name="name">Order lines Tree</field>
281 <field name="model">lunch.order.line</field>
282 <field name="arch" type="xml">
283 <tree string="Order lines Tree">
285 <field name='user_id'/>
286 <field name='supplier' invisible='1'/>
287 <field name='product_id'/>
289 <field name='state'/>
290 <field name='price' sum="Total"/>
291 <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
292 <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
293 <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
298 <!--View for Your orders-->
299 <record model="ir.ui.view" id="orders_tree_view">
300 <field name="name">Orders Tree View</field>
301 <field name="model">lunch.order</field>
302 <field name="arch" type="xml">
303 <tree string="Orders Tree">
305 <field name="order_line_ids"/>
306 <field name="state" />
307 <field name="total" sum="Total"/>
312 <record model="ir.ui.view" id="orders_form_view">
313 <field name="name">Lunch Order</field>
314 <field name="model">lunch.order</field>
315 <field name="arch" type="xml">
316 <form string='Orders Form' version='7.0' class="oe_lunch">
318 <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
323 <field name='user_id'/>
329 <field name='alerts' attrs="{'invisible': ['|',('state','!=','new'),('alerts','=','')]}" class="oe_inline oe_lunch_alert"/>
330 <div name="preferences">
332 <separator string='Select your order'/>
333 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
334 <tree string='List' editable='bottom'>
335 <field name='product_id' on_change='onchange_price(product_id)'/>
336 <field name='note' />
337 <field name='price' />
338 <field name='supplier' invisible="1"/>
339 <field name="state" invisible="1"/>
342 <group class='oe_subtotal_footer oe_right'>
343 <field name='total'/>
351 <!--View for Products-->
352 <record model="ir.ui.view" id="products_tree_view">
353 <field name="name">Products Tree</field>
354 <field name="model">lunch.product</field>
355 <field name="arch" type="xml">
356 <tree string="Products Tree">
358 <field name="category_id"/>
359 <field name="supplier"/>
360 <field name="description"/>
361 <field name="price"/>
366 <record model="ir.ui.view" id="products_form_view">
367 <field name="name">Products Form</field>
368 <field name="model">lunch.product</field>
369 <field name="arch" type="xml">
370 <form string="Products Form" version="7.0">
376 <field name='category_id'/>
377 <field name='supplier'/>
378 <field name='price'/>
380 <label for='description'/>
381 <field name='description'/>
387 <!--view for cashmove-->
388 <record model="ir.ui.view" id="casmove_tree_view">
389 <field name="name">cashmove tree</field>
390 <field name="model">lunch.cashmove</field>
391 <field name="arch" type="xml">
392 <tree string="cashmove tree">
394 <field name="user_id"/>
395 <field name="description"/>
396 <field name="amount" sum="Total"/>
401 <record model="ir.ui.view" id="casmove_form_view">
402 <field name="name">cashmove form</field>
403 <field name="model">lunch.cashmove</field>
404 <field name="arch" type="xml">
405 <form string="cashmove form" version="7.0">
408 <field name="user_id"/>
410 <field name="amount"/>
412 <label for='description'/>
413 <field name="description"/>
419 <!--view for alerts-->
420 <record model="ir.ui.view" id="alert_tree_view">
421 <field name="name">alert tree</field>
422 <field name="model">lunch.alert</field>
423 <field name="arch" type="xml">
424 <tree string="alert tree">
425 <field name="message"/>
426 <field name="alter_type"/>
427 <field name='active_from' widget='float_time'/>
428 <field name='active_to' widget='float_time'/>
433 <record model="ir.ui.view" id="alert_form_view">
434 <field name="name">alert form</field>
435 <field name="model">lunch.alert</field>
436 <field name="arch" type="xml">
437 <form string="alert tree" version="7.0">
439 <group string="Schedule Date">
441 <field name="alter_type"/>
442 <field name="specific_day" attrs="{'invisible': [('alter_type','!=','specific')], 'required':[('alter_type','=','specific')]}"/>
445 <group attrs="{'invisible': [('alter_type','!=','week')]}">
447 <field name="monday"/>
448 <field name="tuesday"/>
449 <field name="wednesday"/>
450 <field name="thursday"/>
453 <field name="friday"/>
454 <field name="saturday"/>
455 <field name="sunday"/>
458 <group string="Schedule Hour">
459 <field name='active_from' widget='float_time'/>
460 <field name='active_to' widget='float_time'/>
462 <group string='Message'>
463 <field name='message' nolabel='1' placeholder="Write the message you want to display during the defined period..."/>