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="Order Month" context="{'group_by':'date'}" help="Supplier Order by Month"/>
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_group' string="My Account grouped" domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}"/>
43 <filter name="group_by_user" string="By User" context="{'group_by':'user_id'}"/>
48 <record id="view_lunch_cashmove_filter" model="ir.ui.view">
49 <field name='name'>lunch cashmove</field>
50 <field name='model'>lunch.cashmove</field>
51 <field name='arch' type='xml'>
52 <search string="lunch cashmove">
53 <field name="description"/>
54 <field name="user_id"/>
55 <group expand="0" string="Group By...">
56 <filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
62 <!--View search for order-->
63 <record id="view_search_my_order" model="ir.ui.view">
64 <field name='name'>lunch orders</field>
65 <field name='model'>lunch.order</field>
66 <field name='arch' type='xml'>
67 <search string="lunch orders">
68 <field name="user_id"/>
70 <field name="order_line_ids"/>
71 <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
72 <filter name='by_users' string="Users" context="{'group_by':'user_id'}"/>
78 <record model="ir.ui.view" id="alert_search_view">
79 <field name="name">Search</field>
80 <field name="model">lunch.alert</field>
81 <field name="arch" type="xml">
82 <search string="Search">
83 <field name="message"/>
88 <!--view for cashmove-->
89 <record model="ir.ui.view" id="casmove_tree_view">
90 <field name="name">cashmove tree</field>
91 <field name="model">lunch.cashmove</field>
92 <field name="arch" type="xml">
93 <tree string="cashmove tree">
95 <field name="user_id"/>
96 <field name="description"/>
97 <field name="amount" sum="Total"/>
102 <record model="ir.ui.view" id="casmove_form_view">
103 <field name="name">cashmove form</field>
104 <field name="model">lunch.cashmove</field>
105 <field name="arch" type="xml">
106 <form string="cashmove form" version="7.0">
109 <field name="user_id"
110 context="{'default_groups_ref': ['base.group_user', 'lunch.group_lunch_user']}"/>
112 <field name="amount"/>
114 <label for='description'/>
115 <field name="description"/>
122 <!--Action for Your Orders-->
123 <record model="ir.actions.act_window" id="action_lunch_order_form">
124 <field name="name">New Order</field>
125 <field name="res_model">lunch.order</field>
126 <field name="view_mode">form</field>
128 <menuitem name="New Order" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
130 <record model="ir.actions.act_window" id="action_lunch_order_tree">
131 <field name="name">Your Orders</field>
132 <field name="res_model">lunch.order</field>
133 <field name="view_mode">tree,form</field>
134 <field name="search_view_id" ref="view_search_my_order"/>
135 <field name="context">{"search_default_is_mine":1}</field>
136 <field name="help" type="html">
137 <p class="oe_view_nocontent_create">
138 Click to create a lunch order.
141 A lunch order is defined by its user, date and order lines.
142 Each order line corresponds to a product, an additional note and a price.
143 Before selecting your order lines, don't forget to read the warnings displayed in the reddish area.
147 <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
149 <record model="ir.ui.view" id="casmove_tree">
150 <field name="name">cashmove tree</field>
151 <field name="model">lunch.cashmove</field>
152 <field name="arch" type="xml">
153 <tree string="cashmove tree" version="7.0" create='false'>
155 <field name="user_id"/>
156 <field name="description"/>
157 <field name="amount" sum="Total"/>
162 <!--Action for Lunch cashmoves-->
163 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
164 <field name="name">Your Account</field>
165 <field name="res_model">lunch.cashmove</field>
166 <field name="view_mode">tree</field>
167 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
168 <field name="context">{"search_default_is_mine_group":1}</field>
169 <field name="view_id" ref="casmove_tree"/>
170 <field name="help" type="html">
172 Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
173 An expense is automatically created when an order is received while a payment is a reimbursement to the company encoded by the manager.
177 <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
179 <!--Action for Administrate Orders group by supplier-->
180 <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
181 <field name="name">Orders by Supplier</field>
182 <field name="res_model">lunch.order.line</field>
183 <field name="view_mode">tree</field>
184 <field name="search_view_id" ref="lunch_order_line_search_view"/>
185 <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
186 <field name="help" type="html">
188 Here you can see today's orders grouped by suppliers.
191 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
192 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
193 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> to announce that the order isn't available
197 <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" />
199 <!--Action for control Supplier-->
200 <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
201 <field name="name">Control Suppliers</field>
202 <field name="res_model">lunch.order.line</field>
203 <field name="view_mode">tree</field>
204 <field name="search_view_id" ref="lunch_order_line_search_view"/>
205 <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
206 <field name="help" type="html">
208 Here you can see every orders grouped by suppliers and by date.
211 - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
212 - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
213 - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> red X to announce that the order isn't available
217 <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
219 <!--Action for Control Accounts-->
220 <record model="ir.actions.act_window" id="action_lunch_control_accounts">
221 <field name="name">Control Accounts</field>
222 <field name="res_model">lunch.cashmove</field>
223 <field name="view_mode">tree,form</field>
224 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
225 <field name="context">{"search_default_group_by_user":1}</field>
226 <field name="view_id" ref="casmove_tree_view"/>
227 <field name="help" type="html">
228 <p class="oe_view_nocontent_create">
229 Click to create a new payment.
232 A cashmove can either be an expense or a payment.<br/>
233 An expense is automatically created at the order receipt.<br/>
234 A payment represents the employee reimbursement to the company.
238 <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
241 <!--Action for Payment cashmove-->
242 <record model="ir.actions.act_window" id="action_lunch_cashmove">
243 <field name="name">Register Cash Moves</field>
244 <field name="res_model">lunch.cashmove</field>
245 <field name="view_mode">tree,form</field>
246 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
247 <field name="context">{"search_default_is_payment":1}</field>
248 <field name="view_id" ref="casmove_tree_view"/>
249 <field name="help" type="html">
250 <p class="oe_view_nocontent_create">
251 Click to create a payment.
254 Here you can see the employees' payment. A payment is a cash move from the employee to the company.
258 <menuitem name="Employee Payments" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
260 <!--Action for Products-->
261 <record model="ir.actions.act_window" id="action_lunch_products">
262 <field name="name">Products</field>
263 <field name="res_model">lunch.product</field>
264 <field name="view_mode">tree,form</field>
265 <field name="help" type="html">
266 <p class="oe_view_nocontent_create">
267 Click to create a product for lunch.
270 A product is defined by its name, category, price and supplier.
274 <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
276 <!--Action for Product categories-->
277 <record model="ir.actions.act_window" id="action_lunch_product_categories">
278 <field name="name">Product Categories</field>
279 <field name="res_model">lunch.product.category</field>
280 <field name="view_mode">tree,form</field>
281 <field name="help" type="html">
282 <p class="oe_view_nocontent_create">
283 Click to create a lunch category.
286 Here you can find every lunch categories for products.
291 <record model="ir.ui.view" id="product_category_form_view">
292 <field name="name">Product category Form</field>
293 <field name="model">lunch.product.category</field>
294 <field name="arch" type="xml">
295 <form string="Products Form" version="7.0">
298 <field name='name' string="Product Category: "/>
305 <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
307 <!--Action for Alert-->
308 <record model="ir.actions.act_window" id="action_lunch_alert">
309 <field name="name">Alerts</field>
310 <field name="res_model">lunch.alert</field>
311 <field name="view_mode">tree,form</field>
312 <field name="search_view_id" ref="alert_search_view"/>
313 <field name="help" type="html">
314 <p class="oe_view_nocontent_create">
315 Click to create a lunch alert.
318 Alerts are used to warn employee from possible issues concerning the lunch orders.
319 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.
323 - Recurency: Everyday<br/>
324 - Time interval: from 00h00 am to 11h59 pm<br/>
325 - Message: "You must order before 10h30 am"
329 <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
331 <!--View for Order lines-->
332 <record model="ir.ui.view" id="orders_order_lines_tree_view">
333 <field name="name">Order lines Tree</field>
334 <field name="model">lunch.order.line</field>
335 <field name="arch" type="xml">
336 <tree string="Order lines Tree" create="false" edit="false">
338 <field name='user_id'/>
339 <field name='supplier' invisible='1'/>
340 <field name='product_id'/>
342 <field name='state'/>
343 <field name='price' sum="Total"/>
344 <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
345 <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
346 <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
351 <!--View for Your orders-->
352 <record model="ir.ui.view" id="orders_tree_view">
353 <field name="name">Orders Tree View</field>
354 <field name="model">lunch.order</field>
355 <field name="arch" type="xml">
356 <tree string="Orders Tree">
358 <field name='user_id'/>
359 <field name="order_line_ids"/>
360 <field name="state" />
361 <field name="total" sum="Total"/>
366 <record model="ir.ui.view" id="orders_form_view">
367 <field name="name">Lunch Order</field>
368 <field name="model">lunch.order</field>
369 <field name="arch" type="xml">
370 <form string='Orders Form' version='7.0' class="oe_lunch">
372 <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
377 <field name='user_id'
378 context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'lunch.group_lunch_user']}"/>
384 <field name='alerts' attrs="{'invisible': ['|',('state','!=','new'),('alerts','=',False)]}" class="oe_inline oe_lunch_alert"/>
385 <div name="preferences">
387 <separator string='Select your order'/>
388 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
389 <tree string='List' editable='bottom'>
390 <field name='product_id' on_change='onchange_price(product_id)'/>
391 <field name='note' />
392 <field name='price' on_change='onchange_price(product_id)'/>
393 <field name='supplier' invisible="1"/>
394 <field name="state" invisible="1"/>
397 <group class='oe_subtotal_footer oe_right'>
398 <field name='total'/>
406 <!--View for Products-->
407 <record model="ir.ui.view" id="products_tree_view">
408 <field name="name">Products Tree</field>
409 <field name="model">lunch.product</field>
410 <field name="arch" type="xml">
411 <tree string="Products Tree">
413 <field name="category_id"/>
414 <field name="supplier"/>
415 <field name="description"/>
416 <field name="price"/>
421 <record model="ir.ui.view" id="products_form_view">
422 <field name="name">Products Form</field>
423 <field name="model">lunch.product</field>
424 <field name="arch" type="xml">
425 <form string="Products Form" version="7.0">
432 <field name='category_id'/>
435 <field name='supplier'/>
436 <field name='price'/>
439 <label for='description'/>
440 <field name='description'/>
446 <!--view for alerts-->
447 <record model="ir.ui.view" id="alert_tree_view">
448 <field name="name">alert tree</field>
449 <field name="model">lunch.alert</field>
450 <field name="arch" type="xml">
451 <tree string="alert tree">
452 <field name="message"/>
453 <field name="alter_type"/>
454 <field name='active_from' widget='float_time'/>
455 <field name='active_to' widget='float_time'/>
460 <record model="ir.ui.view" id="alert_form_view">
461 <field name="name">alert form</field>
462 <field name="model">lunch.alert</field>
463 <field name="arch" type="xml">
464 <form string="alert tree" version="7.0">
466 <group string="Schedule Date">
468 <field name="alter_type" class="oe_inline"/>
469 <field name="specific_day" attrs="{'invisible': [('alter_type','!=','specific')], 'required':[('alter_type','=','specific')]}"/>
472 <group attrs="{'invisible': [('alter_type','!=','week')]}">
474 <field name="monday"/>
475 <field name="tuesday"/>
476 <field name="wednesday"/>
477 <field name="thursday"/>
480 <field name="friday"/>
481 <field name="saturday"/>
482 <field name="sunday"/>
485 <group string="Schedule Hour">
486 <field name='active_from' widget='float_time'/>
487 <field name='active_to' widget='float_time'/>
489 <group string='Message'>
490 <field name='message' nolabel='1' placeholder="Write the message you want to display during the defined period..."/>