5 <menuitem id='menu_lunch' name='Lunch' sequence="300"/>
6 <menuitem name="Lunch Menu" 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 by Supplier and time-->
12 <record model="ir.ui.view" id="supplier_group_by_month_search_view">
13 <field name="name">Search</field>
14 <field name="model">lunch.order.line</field>
15 <field name="type">search</field>
16 <field name="arch" type="xml">
17 <search string="Search">
19 <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
20 <filter name="not_confirmed" string="Not Received" domain="[('state','!=',('confirmed'))]"/>
21 <filter name="comfirmed" string="Received" domain="[('state','=','confirmed')]"/>
22 <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
23 <filter name="group_by_date" string="By Date" context="{'group_by':'date'}"/>
29 <record id="view_lunch_order_filter" model="ir.ui.view">
30 <field name="name">lunch order list</field>
31 <field name="model">lunch.order.line</field>
32 <field name="arch" type="xml">
33 <search string="Search Lunch Order">
35 <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
36 <filter name="not_confirmed" string="Not Confirmed" domain="[('state','!=',('confirmed'))]"/>
37 <filter name="comfirmed" string="Confirmed" domain="[('state','=','confirmed')]"/>
38 <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
39 <filter name="today" string="Today" domain="[('date','=',time.strftime('%%m-%%d-%%Y'))]"/>
44 <!--View Search to group by employee and input/output (cashmoves)-->
45 <record id="view_lunch_employee_payment_filter" model="ir.ui.view">
46 <field name='name'>lunch employee payment</field>
47 <field name='model'>lunch.cashmove</field>
48 <field name='type'>search</field>
49 <field name='arch' type='xml'>
50 <search string="lunch employee payment">
51 <field name="description"/>
52 <filter name='is_payment' string="Payment" domain="[('state','=','payment')]"/>
53 <filter name='is_mine' string="My Account" domain="[('user_id','=',uid)]"/>
58 <record id="view_lunch_cashmove_filter" model="ir.ui.view">
59 <field name='name'>lunch cashmove</field>
60 <field name='model'>lunch.cashmove</field>
61 <field name='type'>search</field>
62 <field name='arch' type='xml'>
63 <search string="lunch cashmove">
64 <field name="description"/>
65 <filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
70 <!--View search for order-->
71 <record id="view_search_my_order" model="ir.ui.view">
72 <field name='name'>lunch orders</field>
73 <field name='model'>lunch.order</field>
74 <field name='type'>search</field>
75 <field name='arch' type='xml'>
76 <search string="lunch orders">
78 <field name="order_line_ids"/>
79 <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
85 <record model="ir.ui.view" id="alert_search_view">
86 <field name="name">Search</field>
87 <field name="model">lunch.alert</field>
88 <field name="type">search</field>
89 <field name="arch" type="xml">
90 <search string="Search">
91 <field name="message"/>
96 <!--Action for Your Orders-->
97 <record model="ir.actions.act_window" id="action_lunch_order_form">
98 <field name="name">Your Orders</field>
99 <field name="res_model">lunch.order</field>
100 <field name="view_mode">form</field>
102 <menuitem name="Your Orders" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
104 <record model="ir.actions.act_window" id="action_lunch_order_tree">
105 <field name="name">Your Orders</field>
106 <field name="res_model">lunch.order</field>
107 <field name="view_mode">tree,form</field>
108 <field name="search_view_id" ref="view_search_my_order"/>
109 <field name="context">{"search_default_is_mine":1}</field>
110 <field name="help" type="html">
111 <p class="oe_view_nocontent_create">
112 Click to create a lunch order.
115 A lunch order is defined by its user, date and order lines.
116 Each order line corresponds to a product, an additional note and a price.
117 Before selecting your order lines, don't forget to read the warnings displayed in the reddish area.
121 <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
123 <!--Action for Lunch cashmoves-->
124 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
125 <field name="name">Your Account</field>
126 <field name="res_model">lunch.cashmove</field>
127 <field name="view_mode">tree</field>
128 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
129 <field name="context">{"search_default_is_mine":1}</field>
130 <field name="help" type="html">
132 Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
133 An expense is automatically created when an order is received while a payment is encoded by the manager.
137 <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
139 <!--Action for Administrate Orders group by supplier-->
140 <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
141 <field name="name">Orders by Supplier</field>
142 <field name="res_model">lunch.order.line</field>
143 <field name="view_mode">tree</field>
144 <field name="search_view_id" ref="view_lunch_order_filter"/>
145 <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
146 <field name="help" type="html">
148 Here you can see today's orders grouped by suppliers.
151 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the meal is ordered <br/>
152 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the meal is received <br/>
153 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> to announce that the meal isn't available
157 <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" />
159 <!--Action for control Supplier-->
160 <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
161 <field name="name">Control Suppliers</field>
162 <field name="res_model">lunch.order.line</field>
163 <field name="view_mode">tree</field>
164 <field name="search_view_id" ref="supplier_group_by_month_search_view"/>
165 <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
166 <field name="help" type="html">
168 Here you can see every orders grouped by suppliers and by date.
171 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the meal is ordered <br/>
172 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the meal is received <br/>
173 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> red X to announce that the meal isn't available
177 <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
179 <!--Action for Control Accounts-->
180 <record model="ir.actions.act_window" id="action_lunch_control_accounts">
181 <field name="name">Control Accounts</field>
182 <field name="res_model">lunch.cashmove</field>
183 <field name="view_mode">tree,form</field>
184 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
185 <field name="context">{"search_default_group_by_user":1}</field>
186 <field name="help" type="html">
187 <p class="oe_view_nocontent_create">
188 Click to create a new payment.
191 A cashmove can either be an expense or a payment.<br/>
192 An expense is automatically created at the order receipt.<br/>
193 A payment represents the employee reimbursement to the company.
197 <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
200 <!--Action for Payment cashmove-->
201 <record model="ir.actions.act_window" id="action_lunch_cashmove">
202 <field name="name">Register Cash Moves</field>
203 <field name="res_model">lunch.cashmove</field>
204 <field name="view_mode">tree,form</field>
205 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
206 <field name="context">{"search_default_is_payment":1}</field>
207 <field name="help" type="html">
208 <p class="oe_view_nocontent_create">
209 Click to create a payment.
212 Here you can see the employees' payment.
216 <menuitem name="Employee's Payment" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
218 <!--Action for Products-->
219 <record model="ir.actions.act_window" id="action_lunch_products">
220 <field name="name">Products</field>
221 <field name="res_model">lunch.product</field>
222 <field name="view_mode">tree,form</field>
223 <field name="help" type="html">
224 <p class="oe_view_nocontent_create">
225 Click to create a product for lunch.
228 A product is defined by its name, category, price and supplier (the supplier must be a lunch supplier).
232 <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
234 <!--Action for Product categories-->
235 <record model="ir.actions.act_window" id="action_lunch_product_categories">
236 <field name="name">Product Categories</field>
237 <field name="res_model">lunch.product.category</field>
238 <field name="view_mode">tree,form</field>
239 <field name="help" type="html">
240 <p class="oe_view_nocontent_create">
241 Click to create a lunch category.
244 Here you can find every lunch categories for products.
249 <record model="ir.ui.view" id="product_category_form_view">
250 <field name="name">Product category Form</field>
251 <field name="model">lunch.product.category</field>
252 <field name="type">form</field>
253 <field name="arch" type="xml">
254 <form string="Products Form" version="7.0">
257 <field name='name' string="Product Category: "/>
264 <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
266 <!--Action for Alert-->
267 <record model="ir.actions.act_window" id="action_lunch_alert">
268 <field name="name">Alerts</field>
269 <field name="res_model">lunch.alert</field>
270 <field name="view_mode">tree,form</field>
271 <field name="search_view_id" ref="alert_search_view"/>
272 <field name="help" type="html">
273 <p class="oe_view_nocontent_create">
274 Click to create a lunch alert.
277 Alerts are used to warn employee from possible issues concerning the lunch orders.
278 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.
282 - Recurency: Everyday<br/>
283 - Time interval: from 00h00 am to 11h59 pm<br/>
284 - Message: "You must order before 10h30 am"
288 <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
290 <!--View for Order lines-->
291 <record model="ir.ui.view" id="orders_order_lines_tree_view">
292 <field name="name">Order lines Tree</field>
293 <field name="model">lunch.order.line</field>
294 <field name="type">tree</field>
295 <field name="arch" type="xml">
296 <tree string="Order lines Tree">
298 <field name='user_id'/>
299 <field name='supplier' invisible='1'/>
300 <field name='product_id'/>
302 <field name='state'/>
303 <field name='price' sum="Total"/>
304 <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
305 <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
306 <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
311 <!--View for Your orders-->
312 <record model="ir.ui.view" id="orders_tree_view">
313 <field name="name">Orders Tree</field>
314 <field name="model">lunch.order</field>
315 <field name="arch" type="xml">
316 <tree string="Orders Tree">
318 <field name="order_line_ids"/>
319 <field name="state" />
320 <field name="total" sum="Total"/>
325 <record model="ir.ui.view" id="orders_form_view">
326 <field name="name">Lunch Order</field>
327 <field name="model">lunch.order</field>
328 <field name="arch" type="xml">
329 <form string='Orders Form' version='7.0' class="oe_lunch">
331 <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
336 <field name='user_id'/>
342 <field name='alerts' attrs="{'invisible': [('state','!=','new')]}" class="oe_inline oe_lunch_alert"/>
343 <div name="preferences">
345 <separator string='Your order'/>
346 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
347 <tree string='List' editable='bottom'>
348 <field name='product_id' on_change='onchange_price(product_id)'/>
349 <field name='note' />
350 <field name='price' />
351 <field name='supplier' invisible="1"/>
352 <field name="state" invisible="1"/>
355 <group class='oe_subtotal_footer oe_right'>
356 <field name='total'/>
364 <!--View for Products-->
365 <record model="ir.ui.view" id="products_tree_view">
366 <field name="name">Products Tree</field>
367 <field name="model">lunch.product</field>
368 <field name="type">tree</field>
369 <field name="arch" type="xml">
370 <tree string="Products Tree">
372 <field name="category_id"/>
373 <field name="supplier"/>
374 <field name="description"/>
375 <field name="price"/>
380 <record model="ir.ui.view" id="products_form_view">
381 <field name="name">Products Form</field>
382 <field name="model">lunch.product</field>
383 <field name="type">form</field>
384 <field name="arch" type="xml">
385 <form string="Products Form" version="7.0">
391 <field name='category_id'/>
392 <field name='supplier'/>
393 <field name='price'/>
395 <label for='description'/>
396 <field name='description'/>
402 <!--view for cashmove-->
403 <record model="ir.ui.view" id="casmove_tree_view">
404 <field name="name">cashmove tree</field>
405 <field name="model">lunch.cashmove</field>
406 <field name="type">tree</field>
407 <field name="arch" type="xml">
408 <tree string="cashmove tree">
410 <field name="user_id"/>
411 <field name="description"/>
412 <field name="amount" sum="Total"/>
417 <record model="ir.ui.view" id="casmove_form_view">
418 <field name="name">cashmove form</field>
419 <field name="model">lunch.cashmove</field>
420 <field name="type">form</field>
421 <field name="arch" type="xml">
422 <form string="cashmove form" version="7.0">
425 <field name="user_id"/>
427 <field name="amount"/>
429 <label for='description'/>
430 <field name="description"/>
436 <!--view for alerts-->
437 <record model="ir.ui.view" id="alert_tree_view">
438 <field name="name">alert tree</field>
439 <field name="model">lunch.alert</field>
440 <field name="type">tree</field>
441 <field name="arch" type="xml">
442 <tree string="alert tree">
443 <field name="message"/>
445 <field name='active_from' widget='float_time'/>
446 <field name='active_to' widget='float_time'/>
451 <record model="ir.ui.view" id="alert_form_view">
452 <field name="name">alert form</field>
453 <field name="model">lunch.alert</field>
454 <field name="type">form</field>
455 <field name="arch" type="xml">
456 <form string="alert tree" version="7.0">
458 <group string="Schedule Date">
461 <field name="specific" attrs="{'invisible': [('day','!=','specific')], 'required':[('day','=','specific')]}"/>
464 <group attrs="{'invisible': [('day','!=','week')]}">
466 <field name="monday"/>
467 <field name="tuesday"/>
468 <field name="wednesday"/>
469 <field name="thursday"/>
472 <field name="friday"/>
473 <field name="saturday"/>
474 <field name="sunday"/>
477 <group string="Schedule Hour">
478 <field name='active_from' widget='float_time'/>
479 <field name='active_to' widget='float_time'/>
481 <group string='Message'>
482 <field name='message' nolabel='1' placeholder="Write the message you want to display during the defined period..."/>