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 <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
83 <!--Action for Your Orders-->
84 <record model="ir.actions.act_window" id="action_lunch_order_form">
85 <field name="name">Your Orders</field>
86 <field name="res_model">lunch.order</field>
87 <field name="view_mode">form</field>
89 <menuitem name="Your Orders" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
91 <record model="ir.actions.act_window" id="action_lunch_order_tree">
92 <field name="name">Your Orders</field>
93 <field name="res_model">lunch.order</field>
94 <field name="view_mode">tree,form</field>
95 <field name="search_view_id" ref="view_search_my_order"/>
96 <field name="context">{"search_default_is_mine":1}</field>
97 <field name="help" type="html">
98 <p class="oe_view_nocontent_create">
99 Click to create a lunch order.
102 Select your favorite meals for today's lunch.
106 <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
108 <!--Action for Lunch cashmoves-->
109 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
110 <field name="name">Your Account</field>
111 <field name="res_model">lunch.cashmove</field>
112 <field name="view_mode">tree</field>
113 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
114 <field name="context">{"search_default_is_mine":1}</field>
115 <field name="help" type="html">
117 Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
121 <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
123 <!--Action for Administrate Orders group by supplier-->
124 <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
125 <field name="name">Orders by Supplier</field>
126 <field name="res_model">lunch.order.line</field>
127 <field name="view_mode">tree</field>
128 <field name="search_view_id" ref="view_lunch_order_filter"/>
129 <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
130 <field name="help" type="html">
132 Here you can see today's orders grouped by suppliers.
136 <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" />
138 <!--Action for control Supplier-->
139 <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
140 <field name="name">Control Suppliers</field>
141 <field name="res_model">lunch.order.line</field>
142 <field name="view_mode">tree</field>
143 <field name="search_view_id" ref="supplier_group_by_month_search_view"/>
144 <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
145 <field name="help" type="html">
147 Here you can see every orders grouped by suppliers and by date.
151 <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
153 <!--Action for Control Accounts-->
154 <record model="ir.actions.act_window" id="action_lunch_control_accounts">
155 <field name="name">Control Accounts</field>
156 <field name="res_model">lunch.cashmove</field>
157 <field name="view_mode">tree,form</field>
158 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
159 <field name="context">{"search_default_group_by_user":1}</field>
160 <field name="help" type="html">
161 <p class="oe_view_nocontent_create">
162 Click to create a new payment.
165 A cashmove can either be an expense or a payment.<br/>
166 An expense is automatically created at the order receipt.<br/>
167 A payment represents the employee reimbursement to the company.
171 <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
174 <!--Action for Payment cashmove-->
175 <record model="ir.actions.act_window" id="action_lunch_cashmove">
176 <field name="name">Register Cash Moves</field>
177 <field name="res_model">lunch.cashmove</field>
178 <field name="view_mode">tree,form</field>
179 <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
180 <field name="context">{"search_default_is_payment":1}</field>
181 <field name="help" type="html">
182 <p class="oe_view_nocontent_create">
183 Click to create a payment.
186 Here you can see the employees' payment.
190 <menuitem name="Employee's Payment" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
192 <!--Action for Products-->
193 <record model="ir.actions.act_window" id="action_lunch_products">
194 <field name="name">Products</field>
195 <field name="res_model">lunch.product</field>
196 <field name="view_mode">tree,form</field>
197 <field name="help" type="html">
198 <p class="oe_view_nocontent_create">
199 Click to create a product for lunch.
202 A product is defined by its name, category, price and supplier (the supplier must be a lunch supplier).
206 <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
208 <!--Action for Product categories-->
209 <record model="ir.actions.act_window" id="action_lunch_product_categories">
210 <field name="name">Product Categories</field>
211 <field name="res_model">lunch.product.category</field>
212 <field name="view_mode">tree,form</field>
213 <field name="help" type="html">
214 <p class="oe_view_nocontent_create">
215 Click to create a lunch category.
218 Here you can find every lunch categories for products.
223 <record model="ir.ui.view" id="product_category_form_view">
224 <field name="name">Product category Form</field>
225 <field name="model">lunch.product.category</field>
226 <field name="type">form</field>
227 <field name="arch" type="xml">
228 <form string="Products Form" version="7.0">
233 <field name='name' string="Product Category: "/>
240 <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
242 <!--Action for Alert-->
243 <record model="ir.actions.act_window" id="action_lunch_alert">
244 <field name="name">Alerts</field>
245 <field name="res_model">lunch.alert</field>
246 <field name="view_mode">tree,form</field>
247 <field name="help" type="html">
248 <p class="oe_view_nocontent_create">
249 Click to create a lunch alert.
252 Alerts are used to warn employee from possible issues concerning the lunch orders.<br/>
253 To create a lunch alert you have to define its recurrency (A specific day of the year, every week or every day), the time interval during which the alert should be executed and the message to display.
257 <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
259 <!--View for Order lines-->
260 <record model="ir.ui.view" id="orders_order_lines_tree_view">
261 <field name="name">Order lines Tree</field>
262 <field name="model">lunch.order.line</field>
263 <field name="type">tree</field>
264 <field name="arch" type="xml">
265 <tree string="Order lines Tree">
267 <field name='user_id'/>
268 <field name='supplier' invisible='1'/>
269 <field name='product_id'/>
271 <field name='state'/>
272 <field name='price' sum="Total"/>
273 <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
274 <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
275 <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
280 <!--View for Your orders-->
281 <record model="ir.ui.view" id="orders_tree_view">
282 <field name="name">Orders Tree</field>
283 <field name="model">lunch.order</field>
284 <field name="arch" type="xml">
285 <tree string="Orders Tree">
287 <field name="order_line_ids"/>
288 <field name="state" />
289 <field name="total" sum="Total"/>
290 <field name="preferences" invisible="1"/>
291 <field name="company_id" invisible="1"/>
296 <record model="ir.ui.view" id="orders_form_view">
297 <field name="name">Lunch Order</field>
298 <field name="model">lunch.order</field>
299 <field name="arch" type="xml">
300 <form string='Orders Form' version='7.0' class="oe_lunch">
302 <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
307 <field name='user_id'/>
308 <field name="company_id" invisible="1"/>
309 <field name='currency_id' invisible='1'/>
315 <field name='alerts' attrs="{'invisible': [('state','!=','new')]}" class="oe_inline oe_lunch_alert"/>
316 <div name="preferences">
318 <separator string='Your order'/>
319 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
320 <tree string='List' editable='bottom'>
321 <field name='product_id' on_change='onchange_price(product_id)'/>
322 <field name='note' />
323 <field name='price' />
324 <field name='supplier' invisible="1"/>
325 <field name="state" invisible="1"/>
328 <group class='oe_subtotal_footer oe_right'>
329 <field name='total'/> <!-- widget='monetary' options="{'currency_field': 'currency_id'}"/>-->
337 <!--View for Products-->
338 <record model="ir.ui.view" id="products_tree_view">
339 <field name="name">Products Tree</field>
340 <field name="model">lunch.product</field>
341 <field name="type">tree</field>
342 <field name="arch" type="xml">
343 <tree string="Products Tree">
345 <field name="category_id"/>
346 <field name="supplier"/>
347 <field name="description"/>
348 <field name="price"/>
349 <field name="active"/>
354 <record model="ir.ui.view" id="products_form_view">
355 <field name="name">Products Form</field>
356 <field name="model">lunch.product</field>
357 <field name="type">form</field>
358 <field name="arch" type="xml">
359 <form string="Products Form" version="7.0">
363 <group colspan="2" col="2">
365 <field name='category_id'/>
366 <field name='supplier'/>
367 <field name='price'/>
368 <field name='active'/>
370 <group colspan="2" col="2">
373 <field name='description'/>
380 <!--view for cashmove-->
381 <record model="ir.ui.view" id="casmove_tree_view">
382 <field name="name">cashmove tree</field>
383 <field name="model">lunch.cashmove</field>
384 <field name="type">tree</field>
385 <field name="arch" type="xml">
386 <tree string="cashmove tree">
388 <field name="user_id"/>
389 <field name="description"/>
390 <field name="amount" sum="Total"/>
395 <record model="ir.ui.view" id="casmove_form_view">
396 <field name="name">cashmove form</field>
397 <field name="model">lunch.cashmove</field>
398 <field name="type">form</field>
399 <field name="arch" type="xml">
400 <form string="cashmove form" version="7.0">
404 <group colspan="2" col="2">
405 <field name="user_id"/>
407 <field name="amount"/>
409 <group colspan="2" col="2">
412 <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="type">tree</field>
424 <field name="arch" type="xml">
425 <tree string="alert tree">
426 <field name="message"/>
428 <field name='active_from' widget='float_time'/>
429 <field name='active_to' widget='float_time'/>
430 <field name="lunch_active"/>
435 <record model="ir.ui.view" id="alert_form_view">
436 <field name="name">alert tree</field>
437 <field name="model">lunch.alert</field>
438 <field name="type">form</field>
439 <field name="arch" type="xml">
440 <form string="alert tree" version="7.0">
444 <separator string="Schedule Date" colspan="4"/>
445 <group col="2" colspan="2">
447 <field name="specific" attrs="{'invisible': [('day','!=','specific')]}"/>
449 <group col="2" colspan="2">
451 <group col="2" attrs="{'invisible': [('day','!=','week')]}">
452 <field name="monday"/>
453 <field name="tuesday"/>
454 <field name="wednesday"/>
455 <field name="thursday"/>
457 <group col="2" attrs="{'invisible': [('day','!=','week')]}">
458 <field name="friday"/>
459 <field name="saturday"/>
460 <field name="sunday"/>
462 <separator string="Schedule Hour" colspan="4"/>
463 <group col="2" colspan="2">
464 <field name='active_from' widget='float_time'/>
465 <field name='active_to' widget='float_time'/>
467 <group col="2" colspan="2">
469 <separator string="Alert Informations" colspan="4"/>
470 <group col="2" colspan="2">
471 <field name='lunch_active'/>
472 <field name='message' placeholder="Write the message you want to display during the defined period..."/>
474 <group col="2" colspan="2">
481 <record model='ir.ui.view' id='partner_instructor_form_view'>
482 <field name='name'>partner.supplier.name.form</field>
483 <field name='model'>res.partner</field>
484 <field name='type'>form</field>
485 <field name='inherit_id' ref='base.view_partner_form' />
486 <field name='arch' type='xml'>
487 <field name='title' position='after'>
488 <field name='supplier_lunch'/>