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">
67 <field name="user_id"/>
69 <field name="order_line_ids"/>
70 <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
76 <record model="ir.ui.view" id="alert_search_view">
77 <field name="name">Search</field>
78 <field name="model">lunch.alert</field>
79 <field name="arch" type="xml">
80 <search string="Search">
81 <field name="message"/>
86 <!--Action for Your Orders-->
87 <record model="ir.actions.act_window" id="action_lunch_order_form">
88 <field name="name">New Order</field>
89 <field name="res_model">lunch.order</field>
90 <field name="view_mode">form</field>
92 <menuitem name="New Order" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
94 <record model="ir.actions.act_window" id="action_lunch_order_tree">
95 <field name="name">Your Orders</field>
96 <field name="res_model">lunch.order</field>
97 <field name="view_mode">tree,form</field>
98 <field name="search_view_id" ref="view_search_my_order"/>
99 <field name="context">{"search_default_is_mine":1}</field>
100 <field name="help" type="html">
101 <p class="oe_view_nocontent_create">
102 Click to create a lunch order.
105 A lunch order is defined by its user, date and order lines.
106 Each order line corresponds to a product, an additional note and a price.
107 Before selecting your order lines, don't forget to read the warnings displayed in the reddish area.
111 <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
113 <record model="ir.ui.view" id="casmove_tree">
114 <field name="name">cashmove tree</field>
115 <field name="model">lunch.cashmove</field>
116 <field name="arch" type="xml">
117 <tree string="cashmove tree" version="7.0" create='false'>
119 <field name="user_id"/>
120 <field name="description"/>
121 <field name="amount" sum="Total"/>
126 <!--Action for Lunch cashmoves-->
127 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
128 <field name="name">Your Account</field>
129 <field name="res_model">lunch.cashmove</field>
130 <field name="view_mode">tree</field>
131 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
132 <field name="context">{"search_default_is_mine":1}</field>
133 <field name="view_id" ref="casmove_tree"/>
134 <field name="help" type="html">
136 Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
137 An expense is automatically created when an order is received while a payment is a reimbursement to the company encoded by the manager.
141 <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
143 <!--Action for Administrate Orders group by supplier-->
144 <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
145 <field name="name">Orders by Supplier</field>
146 <field name="res_model">lunch.order.line</field>
147 <field name="view_mode">tree</field>
148 <field name="search_view_id" ref="lunch_order_line_search_view"/>
149 <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
150 <field name="help" type="html">
152 Here you can see today's orders grouped by suppliers.
155 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
156 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
157 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> to announce that the order isn't available
161 <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" />
163 <!--Action for control Supplier-->
164 <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
165 <field name="name">Control Suppliers</field>
166 <field name="res_model">lunch.order.line</field>
167 <field name="view_mode">tree</field>
168 <field name="search_view_id" ref="lunch_order_line_search_view"/>
169 <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
170 <field name="help" type="html">
172 Here you can see every orders grouped by suppliers and by date.
175 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
176 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
177 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> red X to announce that the order isn't available
181 <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
183 <!--Action for Control Accounts-->
184 <record model="ir.actions.act_window" id="action_lunch_control_accounts">
185 <field name="name">Control Accounts</field>
186 <field name="res_model">lunch.cashmove</field>
187 <field name="view_mode">tree,form</field>
188 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
189 <field name="context">{"search_default_group_by_user":1}</field>
190 <field name="view_id" ref="casmove_tree_view"/>
191 <field name="help" type="html">
192 <p class="oe_view_nocontent_create">
193 Click to create a new payment.
196 A cashmove can either be an expense or a payment.<br/>
197 An expense is automatically created at the order receipt.<br/>
198 A payment represents the employee reimbursement to the company.
202 <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
205 <!--Action for Payment cashmove-->
206 <record model="ir.actions.act_window" id="action_lunch_cashmove">
207 <field name="name">Register Cash Moves</field>
208 <field name="res_model">lunch.cashmove</field>
209 <field name="view_mode">tree,form</field>
210 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
211 <field name="context">{"search_default_is_payment":1}</field>
212 <field name="view_id" ref="casmove_tree_view"/>
213 <field name="help" type="html">
214 <p class="oe_view_nocontent_create">
215 Click to create a payment.
218 Here you can see the employees' payment. A payment is a cash move from the employee to the company.
222 <menuitem name="Employee Payments" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
224 <!--Action for Products-->
225 <record model="ir.actions.act_window" id="action_lunch_products">
226 <field name="name">Products</field>
227 <field name="res_model">lunch.product</field>
228 <field name="view_mode">tree,form</field>
229 <field name="help" type="html">
230 <p class="oe_view_nocontent_create">
231 Click to create a product for lunch.
234 A product is defined by its name, category, price and supplier.
238 <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
240 <!--Action for Product categories-->
241 <record model="ir.actions.act_window" id="action_lunch_product_categories">
242 <field name="name">Product Categories</field>
243 <field name="res_model">lunch.product.category</field>
244 <field name="view_mode">tree,form</field>
245 <field name="help" type="html">
246 <p class="oe_view_nocontent_create">
247 Click to create a lunch category.
250 Here you can find every lunch categories for products.
255 <record model="ir.ui.view" id="product_category_form_view">
256 <field name="name">Product category Form</field>
257 <field name="model">lunch.product.category</field>
258 <field name="arch" type="xml">
259 <form string="Products Form" version="7.0">
262 <field name='name' string="Product Category: "/>
269 <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
271 <!--Action for Alert-->
272 <record model="ir.actions.act_window" id="action_lunch_alert">
273 <field name="name">Alerts</field>
274 <field name="res_model">lunch.alert</field>
275 <field name="view_mode">tree,form</field>
276 <field name="search_view_id" ref="alert_search_view"/>
277 <field name="help" type="html">
278 <p class="oe_view_nocontent_create">
279 Click to create a lunch alert.
282 Alerts are used to warn employee from possible issues concerning the lunch orders.
283 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.
287 - Recurency: Everyday<br/>
288 - Time interval: from 00h00 am to 11h59 pm<br/>
289 - Message: "You must order before 10h30 am"
293 <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
295 <!--View for Order lines-->
296 <record model="ir.ui.view" id="orders_order_lines_tree_view">
297 <field name="name">Order lines Tree</field>
298 <field name="model">lunch.order.line</field>
299 <field name="arch" type="xml">
300 <tree string="Order lines Tree">
302 <field name='user_id'/>
303 <field name='supplier' invisible='1'/>
304 <field name='product_id'/>
306 <field name='state'/>
307 <field name='price' sum="Total"/>
308 <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
309 <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
310 <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
315 <!--View for Your orders-->
316 <record model="ir.ui.view" id="orders_tree_view">
317 <field name="name">Orders Tree View</field>
318 <field name="model">lunch.order</field>
319 <field name="arch" type="xml">
320 <tree string="Orders Tree">
322 <field name="order_line_ids"/>
323 <field name="state" />
324 <field name="total" sum="Total"/>
329 <record model="ir.ui.view" id="orders_form_view">
330 <field name="name">Lunch Order</field>
331 <field name="model">lunch.order</field>
332 <field name="arch" type="xml">
333 <form string='Orders Form' version='7.0' class="oe_lunch">
335 <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
340 <field name='user_id'/>
346 <field name='alerts' attrs="{'invisible': ['|',('state','!=','new'),('alerts','=',False)]}" class="oe_inline oe_lunch_alert"/>
347 <div name="preferences">
349 <separator string='Select your order'/>
350 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
351 <tree string='List' editable='bottom'>
352 <field name='product_id' on_change='onchange_price(product_id)'/>
353 <field name='note' />
354 <field name='price' on_change='onchange_price(product_id)'/>
355 <field name='supplier' invisible="1"/>
356 <field name="state" invisible="1"/>
359 <group class='oe_subtotal_footer oe_right'>
360 <field name='total'/>
368 <!--View for Products-->
369 <record model="ir.ui.view" id="products_tree_view">
370 <field name="name">Products Tree</field>
371 <field name="model">lunch.product</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="arch" type="xml">
387 <form string="Products Form" version="7.0">
393 <field name='category_id'/>
394 <field name='supplier'/>
395 <field name='price'/>
397 <label for='description'/>
398 <field name='description'/>
404 <!--view for cashmove-->
405 <record model="ir.ui.view" id="casmove_tree_view">
406 <field name="name">cashmove tree</field>
407 <field name="model">lunch.cashmove</field>
408 <field name="arch" type="xml">
409 <tree string="cashmove tree">
411 <field name="user_id"/>
412 <field name="description"/>
413 <field name="amount" sum="Total"/>
418 <record model="ir.ui.view" id="casmove_form_view">
419 <field name="name">cashmove form</field>
420 <field name="model">lunch.cashmove</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="arch" type="xml">
441 <tree string="alert tree">
442 <field name="message"/>
443 <field name="alter_type"/>
444 <field name='active_from' widget='float_time'/>
445 <field name='active_to' widget='float_time'/>
450 <record model="ir.ui.view" id="alert_form_view">
451 <field name="name">alert form</field>
452 <field name="model">lunch.alert</field>
453 <field name="arch" type="xml">
454 <form string="alert tree" version="7.0">
456 <group string="Schedule Date">
458 <field name="alter_type"/>
459 <field name="specific_day" attrs="{'invisible': [('alter_type','!=','specific')], 'required':[('alter_type','=','specific')]}"/>
462 <group attrs="{'invisible': [('alter_type','!=','week')]}">
464 <field name="monday"/>
465 <field name="tuesday"/>
466 <field name="wednesday"/>
467 <field name="thursday"/>
470 <field name="friday"/>
471 <field name="saturday"/>
472 <field name="sunday"/>
475 <group string="Schedule Hour">
476 <field name='active_from' widget='float_time'/>
477 <field name='active_to' widget='float_time'/>
479 <group string='Message'>
480 <field name='message' nolabel='1' placeholder="Write the message you want to display during the defined period..."/>