5 <menuitem id='menu_lunch' name='Lunch' sequence="300"/>
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 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="user_id"/>
52 <field name="description"/>
53 <filter name='is_payment' string="Payment" domain="[('state','=','payment')]"/>
54 <filter name='is_mine' string="My Account" domain="[('user_id','=',uid)]"/>
59 <record id="view_lunch_cashmove_filter" model="ir.ui.view">
60 <field name='name'>lunch cashmove</field>
61 <field name='model'>lunch.cashmove</field>
62 <field name='type'>search</field>
63 <field name='arch' type='xml'>
64 <search string="lunch cashmove">
65 <field name="user_id"/>
66 <field name="description"/>
67 <filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
72 <!--View search for order-->
73 <record id="view_search_my_order" model="ir.ui.view">
74 <field name='name'>lunch orders</field>
75 <field name='model'>lunch.order</field>
76 <field name='type'>search</field>
77 <field name='arch' type='xml'>
78 <search string="lunch orders">
80 <field name="order_line_ids"/>
81 <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
87 <record model="ir.ui.view" id="alert_search_view">
88 <field name="name">Search</field>
89 <field name="model">lunch.alert</field>
90 <field name="type">search</field>
91 <field name="arch" type="xml">
92 <search string="Search">
93 <field name="message"/>
98 <!--Action for Your Orders-->
99 <record model="ir.actions.act_window" id="action_lunch_order_form">
100 <field name="name">Your Order</field>
101 <field name="res_model">lunch.order</field>
102 <field name="view_mode">form</field>
104 <menuitem name="Your Order" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
106 <record model="ir.actions.act_window" id="action_lunch_order_tree">
107 <field name="name">Your Orders</field>
108 <field name="res_model">lunch.order</field>
109 <field name="view_mode">tree,form</field>
110 <field name="search_view_id" ref="view_search_my_order"/>
111 <field name="context">{"search_default_is_mine":1}</field>
112 <field name="help" type="html">
113 <p class="oe_view_nocontent_create">
114 Click to create a lunch order.
117 A lunch order is defined by its user, date and order lines.
118 Each order line corresponds to a product, an additional note and a price.
119 Before selecting your order lines, don't forget to read the warnings displayed in the reddish area.
123 <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
125 <!--Action for Lunch cashmoves-->
126 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
127 <field name="name">Your Account</field>
128 <field name="res_model">lunch.cashmove</field>
129 <field name="view_mode">tree</field>
130 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
131 <field name="context">{"search_default_is_mine":1}</field>
132 <field name="help" type="html">
134 Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
135 An expense is automatically created when an order is received while a payment is a reimbursement to the company encoded by the manager.
139 <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
141 <!--Action for Administrate Orders group by supplier-->
142 <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
143 <field name="name">Orders by Supplier</field>
144 <field name="res_model">lunch.order.line</field>
145 <field name="view_mode">tree</field>
146 <field name="search_view_id" ref="view_lunch_order_filter"/>
147 <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
148 <field name="help" type="html">
150 Here you can see today's orders grouped by suppliers.
153 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
154 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
155 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> to announce that the order isn't available
159 <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" />
161 <!--Action for control Supplier-->
162 <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
163 <field name="name">Control Suppliers</field>
164 <field name="res_model">lunch.order.line</field>
165 <field name="view_mode">tree</field>
166 <field name="search_view_id" ref="supplier_group_by_month_search_view"/>
167 <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
168 <field name="help" type="html">
170 Here you can see every orders grouped by suppliers and by date.
173 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
174 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
175 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> red X to announce that the order isn't available
179 <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
181 <!--Action for Control Accounts-->
182 <record model="ir.actions.act_window" id="action_lunch_control_accounts">
183 <field name="name">Control Accounts</field>
184 <field name="res_model">lunch.cashmove</field>
185 <field name="view_mode">tree,form</field>
186 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
187 <field name="context">{"search_default_group_by_user":1}</field>
188 <field name="help" type="html">
189 <p class="oe_view_nocontent_create">
190 Click to create a new payment.
193 A cashmove can either be an expense or a payment.<br/>
194 An expense is automatically created at the order receipt.<br/>
195 A payment represents the employee reimbursement to the company.
199 <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
202 <!--Action for Payment cashmove-->
203 <record model="ir.actions.act_window" id="action_lunch_cashmove">
204 <field name="name">Register Cash Moves</field>
205 <field name="res_model">lunch.cashmove</field>
206 <field name="view_mode">tree,form</field>
207 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
208 <field name="context">{"search_default_is_payment":1}</field>
209 <field name="help" type="html">
210 <p class="oe_view_nocontent_create">
211 Click to create a payment.
214 Here you can see the employees' payment. A payment is a cash move from the employee to the company.
218 <menuitem name="Employee's Payment" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
220 <!--Action for Products-->
221 <record model="ir.actions.act_window" id="action_lunch_products">
222 <field name="name">Products</field>
223 <field name="res_model">lunch.product</field>
224 <field name="view_mode">tree,form</field>
225 <field name="help" type="html">
226 <p class="oe_view_nocontent_create">
227 Click to create a product for lunch.
230 A product is defined by its name, category, price and supplier.
234 <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
236 <!--Action for Product categories-->
237 <record model="ir.actions.act_window" id="action_lunch_product_categories">
238 <field name="name">Product Categories</field>
239 <field name="res_model">lunch.product.category</field>
240 <field name="view_mode">tree,form</field>
241 <field name="help" type="html">
242 <p class="oe_view_nocontent_create">
243 Click to create a lunch category.
246 Here you can find every lunch categories for products.
251 <record model="ir.ui.view" id="product_category_form_view">
252 <field name="name">Product category Form</field>
253 <field name="model">lunch.product.category</field>
254 <field name="type">form</field>
255 <field name="arch" type="xml">
256 <form string="Products Form" version="7.0">
259 <field name='name' string="Product Category: "/>
266 <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
268 <!--Action for Alert-->
269 <record model="ir.actions.act_window" id="action_lunch_alert">
270 <field name="name">Alerts</field>
271 <field name="res_model">lunch.alert</field>
272 <field name="view_mode">tree,form</field>
273 <field name="search_view_id" ref="alert_search_view"/>
274 <field name="help" type="html">
275 <p class="oe_view_nocontent_create">
276 Click to create a lunch alert.
279 Alerts are used to warn employee from possible issues concerning the lunch orders.
280 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.
284 - Recurency: Everyday<br/>
285 - Time interval: from 00h00 am to 11h59 pm<br/>
286 - Message: "You must order before 10h30 am"
290 <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
292 <!--View for Order lines-->
293 <record model="ir.ui.view" id="orders_order_lines_tree_view">
294 <field name="name">Order lines Tree</field>
295 <field name="model">lunch.order.line</field>
296 <field name="type">tree</field>
297 <field name="arch" type="xml">
298 <tree string="Order lines Tree">
300 <field name='user_id'/>
301 <field name='supplier' invisible='1'/>
302 <field name='product_id'/>
304 <field name='state'/>
305 <field name='price' sum="Total"/>
306 <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
307 <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
308 <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
313 <!--View for Your orders-->
314 <record model="ir.ui.view" id="orders_tree_view">
315 <field name="name">Orders Tree View</field>
316 <field name="model">lunch.order</field>
317 <field name="type">tree</field>
318 <field name="arch" type="xml">
319 <tree string="Orders Tree">
321 <field name="order_line_ids"/>
322 <field name="state" />
323 <field name="total" sum="Total"/>
328 <record model="ir.ui.view" id="orders_form_view">
329 <field name="name">Lunch Order</field>
330 <field name="model">lunch.order</field>
331 <field name="arch" type="xml">
332 <form string='Orders Form' version='7.0' class="oe_lunch">
334 <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
339 <field name='user_id'/>
345 <field name='alerts' attrs="{'invisible': ['|',('state','!=','new'),('alerts','=','')]}" class="oe_inline oe_lunch_alert"/>
346 <div name="preferences">
348 <separator string='Select your order'/>
349 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
350 <tree string='List' editable='bottom'>
351 <field name='product_id' on_change='onchange_price(product_id)'/>
352 <field name='note' />
353 <field name='price' />
354 <field name='supplier' invisible="1"/>
355 <field name="state" invisible="1"/>
358 <group class='oe_subtotal_footer oe_right'>
359 <field name='total'/>
367 <!--View for Products-->
368 <record model="ir.ui.view" id="products_tree_view">
369 <field name="name">Products Tree</field>
370 <field name="model">lunch.product</field>
371 <field name="type">tree</field>
372 <field name="arch" type="xml">
373 <tree string="Products Tree">
375 <field name="category_id"/>
376 <field name="supplier"/>
377 <field name="description"/>
378 <field name="price"/>
383 <record model="ir.ui.view" id="products_form_view">
384 <field name="name">Products Form</field>
385 <field name="model">lunch.product</field>
386 <field name="type">form</field>
387 <field name="arch" type="xml">
388 <form string="Products Form" version="7.0">
394 <field name='category_id'/>
395 <field name='supplier'/>
396 <field name='price'/>
398 <label for='description'/>
399 <field name='description'/>
405 <!--view for cashmove-->
406 <record model="ir.ui.view" id="casmove_tree_view">
407 <field name="name">cashmove tree</field>
408 <field name="model">lunch.cashmove</field>
409 <field name="type">tree</field>
410 <field name="arch" type="xml">
411 <tree string="cashmove tree">
413 <field name="user_id"/>
414 <field name="description"/>
415 <field name="amount" sum="Total"/>
420 <record model="ir.ui.view" id="casmove_form_view">
421 <field name="name">cashmove form</field>
422 <field name="model">lunch.cashmove</field>
423 <field name="type">form</field>
424 <field name="arch" type="xml">
425 <form string="cashmove form" version="7.0">
428 <field name="user_id"/>
430 <field name="amount"/>
432 <label for='description'/>
433 <field name="description"/>
439 <!--view for alerts-->
440 <record model="ir.ui.view" id="alert_tree_view">
441 <field name="name">alert tree</field>
442 <field name="model">lunch.alert</field>
443 <field name="type">tree</field>
444 <field name="arch" type="xml">
445 <tree string="alert tree">
446 <field name="message"/>
448 <field name='active_from' widget='float_time'/>
449 <field name='active_to' widget='float_time'/>
454 <record model="ir.ui.view" id="alert_form_view">
455 <field name="name">alert form</field>
456 <field name="model">lunch.alert</field>
457 <field name="type">form</field>
458 <field name="arch" type="xml">
459 <form string="alert tree" version="7.0">
461 <group string="Schedule Date">
464 <field name="specific" attrs="{'invisible': [('day','!=','specific')], 'required':[('day','=','specific')]}"/>
467 <group attrs="{'invisible': [('day','!=','week')]}">
469 <field name="monday"/>
470 <field name="tuesday"/>
471 <field name="wednesday"/>
472 <field name="thursday"/>
475 <field name="friday"/>
476 <field name="saturday"/>
477 <field name="sunday"/>
480 <group string="Schedule Hour">
481 <field name='active_from' widget='float_time'/>
482 <field name='active_to' widget='float_time'/>
484 <group string='Message'>
485 <field name='message' nolabel='1' placeholder="Write the message you want to display during the defined period..."/>