[IMP] CSS lunch
[odoo/odoo.git] / addons / lunch / lunch_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4         <!--Menu and Title-->
5         <menuitem id='menu_lunch' name='Lunch' />
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"/>
10         
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">
18                     <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
19                     <filter name="not_confirmed" string="Not Confirmed" domain="[('state','!=',('confirmed'))]"/>
20                     <filter name="comfirmed" string="Confirmed" domain="[('state','=','confirmed')]"/>
21                     <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
22                     <filter name="group_by_date" string="By Date" context="{'group_by':'date'}"/>
23                 </search>
24             </field>
25         </record>
26
27         <record id="view_lunch_order_filter" model="ir.ui.view">
28             <field name="name">lunch order list</field>
29             <field name="model">lunch.order.line</field>
30             <field name="arch" type="xml">
31                 <search string="Search Lunch Order">
32                     <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
33                     <filter name="not_confirmed" string="Not Confirmed" domain="[('state','!=',('confirmed'))]"/>
34                     <filter name="comfirmed" string="Confirmed" domain="[('state','=','confirmed')]"/>
35                     <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
36                     <filter name="today" string="Today" domain="[('date','=',time.strftime('%%m-%%d-%%Y'))]"/>
37                 </search>
38             </field>
39         </record>
40
41         <!--View Search to group by employee and input/output (cashmoves)-->
42         <record id="view_lunch_employee_payment_filter" model="ir.ui.view">
43             <field name='name'>lunch employee payment</field>
44             <field name='model'>lunch.cashmove</field>
45             <field name='type'>search</field>
46             <field name='arch' type='xml'>
47                 <search string="lunch employee payment">
48                     <filter name='is_payment' string="Payment" domain="[('state','=','payment')]"/>
49                     <filter name='is_mine' string="My Account" domain="[('user_id','=',uid)]"/>
50                 </search>
51             </field>
52         </record>
53
54         <record id="view_lunch_cashmove_filter" model="ir.ui.view">
55             <field name='name'>lunch cashmove</field>
56             <field name='model'>lunch.cashmove</field>
57             <field name='type'>search</field>
58             <field name='arch' type='xml'>
59                 <search string="lunch cashmove">
60                     <filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
61                 </search>
62             </field>
63         </record>
64
65         <!--View search for order-->
66         <record id="view_search_my_order" model="ir.ui.view">
67             <field name='name'>lunch orders</field>
68             <field name='model'>lunch.order</field>
69             <field name='type'>search</field>
70             <field name='arch' type='xml'>
71                 <search string="lunch orders">
72                     <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
73                 </search>
74             </field>
75         </record>
76
77         <!--Action for Your Orders-->
78         <record model="ir.actions.act_window" id="action_lunch_order_form">
79             <field name="name">Your Orders</field>
80             <field name="res_model">lunch.order</field>
81             <field name="view_mode">form</field>
82         </record>
83         <menuitem name="Your Orders" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
84
85         <record model="ir.actions.act_window" id="action_lunch_order_tree">
86             <field name="name">Your Orders</field>
87             <field name="res_model">lunch.order</field>
88             <field name="view_mode">tree,form</field>
89             <field name="search_view_id" ref="view_search_my_order"/>
90             <field name="context">{"search_default_is_mine":1}</field>
91             <field name="help" type="html">
92             <p class="oe_view_nocontent_create">
93                 Click to create a lunch order. 
94             </p>
95             <p>
96                 Use lunch order if you need to order any food for your lunch.
97               </p>
98             </field>
99         </record>
100         <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
101
102         <!--Action for Lunch cashmoves-->
103         <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
104             <field name="name">Your Account</field>
105             <field name="res_model">lunch.cashmove</field>
106             <field name="view_mode">tree</field>
107             <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
108             <field name="context">{"search_default_is_mine":1}</field>
109             <field name="help" type="html">
110               <p>
111                 Here you can see your cash moves. There are your orders and refund.
112               </p>
113             </field>
114         </record>
115         <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
116
117         <!--Action for Administrate Orders group by supplier-->
118         <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
119             <field name="name">Orders by Supplier</field>
120             <field name="res_model">lunch.order.line</field>
121             <field name="view_mode">tree</field>
122             <field name="search_view_id" ref="view_lunch_order_filter"/>
123             <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
124             <field name="help" type="html">
125               <p>
126                 Here you can see the orders of the day grouped by suppliers.
127               </p>
128             </field>
129         </record>
130         <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" />
131
132         <!--Action for control Supplier-->
133         <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
134             <field name="name">Control Suppliers</field>
135             <field name="res_model">lunch.order.line</field>
136             <field name="view_mode">tree</field>
137             <field name="search_view_id" ref="supplier_group_by_month_search_view"/> 
138             <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
139             <field name="help" type="html">
140               <p>
141                 Here you can see the orders of the month grouped by suppliers.
142               </p>
143             </field>
144         </record>
145         <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
146
147         <!--Action for Control Accounts-->
148         <record model="ir.actions.act_window" id="action_lunch_control_accounts">
149             <field name="name">Control Accounts</field>
150             <field name="res_model">lunch.cashmove</field>
151             <field name="view_mode">tree,form</field>
152             <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
153             <field name="context">{"search_default_group_by_user":1}</field>
154             <field name="help" type="html">
155                 <p class="oe_view_nocontent_create">
156                 Click to create a transaction. 
157             </p>
158               <p>
159                 The different cash moves are used to see the orders but also the
160                 employees' refunds.
161               </p>
162             </field>
163         </record>
164         <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
165
166
167         <!--Action for Payment cashmove-->
168         <record model="ir.actions.act_window" id="action_lunch_cashmove">
169             <field name="name">Register Cash Moves</field>
170             <field name="res_model">lunch.cashmove</field>
171             <field name="view_mode">tree,form</field>
172             <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
173             <field name="context">{"search_default_is_payment":1}</field>
174             <field name="help" type="html">
175                 <p class="oe_view_nocontent_create">
176                 Click to create a payment. 
177             </p>
178               <p>
179                 Here you can see the employees' refund.
180               </p>
181             </field>
182         </record>
183         <menuitem name="Employee's Payment" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
184
185         <!--Action for Products-->
186         <record model="ir.actions.act_window" id="action_lunch_products">
187             <field name="name">Products</field>
188             <field name="res_model">lunch.product</field>
189             <field name="view_mode">tree,form</field>
190             <field name="help" type="html">
191                 <p class="oe_view_nocontent_create">
192                 Click to create a product for lunch. 
193             </p>
194               <p>
195                 A product is defined by its name, category, price and supplier.
196               </p>
197             </field>
198         </record>
199         <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
200
201         <!--Action for Product categories-->
202         <record model="ir.actions.act_window" id="action_lunch_product_categories">
203             <field name="name">Product Categories</field>
204             <field name="res_model">lunch.product.category</field>
205             <field name="view_mode">tree,form</field>
206             <field name="help" type="html">
207                 <p class="oe_view_nocontent_create">
208                 Click to create a lunch category. 
209             </p>
210               <p>
211                 Here you can find every lunch categories for products.
212               </p>
213             </field>
214         </record>
215
216         <record model="ir.ui.view" id="product_category_form_view">
217             <field name="name">Product category Form</field>
218             <field name="model">lunch.product.category</field>
219             <field name="type">form</field>
220             <field name="arch" type="xml">
221                 <form string="Products Form" version="7.0">
222                     <header>
223                     </header>
224                     <sheet>
225                         <group>
226                         <field name='name' string="Product Category: "/>
227                     </group>
228                     </sheet>
229                 </form>
230             </field>
231         </record>
232
233         <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
234
235         <!--Action for Alert-->
236         <record model="ir.actions.act_window" id="action_lunch_alert">
237             <field name="name">Alerts</field>
238             <field name="res_model">lunch.alert</field>
239             <field name="view_mode">tree,form</field>
240             <field name="help" type="html">
241                 <p class="oe_view_nocontent_create">
242                 Click to create a lunch alert. 
243             </p>
244               <p>
245                 Alerts are used to warn employee and user from possible issues about the lunch.
246               </p>
247             </field>
248         </record>
249         <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
250
251         <!--View for Order lines-->
252         <record model="ir.ui.view" id="orders_order_lines_tree_view">
253             <field name="name">Order lines Tree</field>
254             <field name="model">lunch.order.line</field>
255             <field name="type">tree</field>
256             <field name="arch" type="xml">
257                 <tree string="Order lines Tree"> 
258                     <field name='date'/>
259                     <field name='user_id'/>
260                     <field name='supplier' invisible='1'/> 
261                     <field name='product_id'/>                             
262                     <field name='note'/>
263                     <field name='state'/>
264                     <field name='price' sum="Total"/>
265                     <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','=','confirmed')]}"/>
266                     <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
267                 </tree>
268             </field>
269         </record>
270
271         <!--View for Your orders-->
272         <record model="ir.ui.view" id="orders_tree_view">
273             <field name="name">Orders Tree</field>
274             <field name="model">lunch.order</field>
275             <field name="arch" type="xml">
276                 <tree string="Orders Tree">
277                     <field name="date"/>
278                     <field name="order_line_ids"/>
279                     <field name="state" />
280                     <field name="total" sum="Total"/>
281                     <field name="preferences" invisible="1"/>
282                     <field name="company_id" invisible="1"/>
283                 </tree>
284             </field>
285         </record>
286        
287         <record model="ir.ui.view" id="orders_form_view">
288             <field name="name">Lunch Order</field>
289             <field name="model">lunch.order</field>
290             <field name="arch" type="xml">
291                 <form string='Orders Form' version='7.0' class="oe_lunch">
292                     <header>
293                         <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
294                     </header>
295                     <sheet>
296                         <group>
297                             <group>
298                                 <field name='user_id'/>
299                                 <field name="company_id" invisible="1"/>
300                                 <field name='currency_id' invisible='1'/>
301                             </group>
302                             <group> 
303                                 <field name='date'/>
304                             </group>
305                         </group>
306                         <field name='alerts' attrs="{'invisible': [('state','!=','new')]}" class="oe_inline oe_lunch_alert"/> 
307                         <div name="preferences">
308                         </div>
309                         <separator string='Your order'/>
310                         <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
311                             <tree string='List' editable='bottom'>
312                                 <field name='product_id' on_change='onchange_price(product_id)'/>
313                                 <field name='note' />
314                                 <field name='price' />
315                                 <field name='supplier' invisible="1"/>
316                                 <field name="state" invisible="1"/>
317                             </tree>
318                         </field> 
319                         <group class='oe_subtotal_footer oe_right'>
320                             <field name='total'/> <!-- widget='monetary' options="{'currency_field': 'currency_id'}"/>-->
321                         </group>
322                         <br/><br/>
323                     </sheet>
324                 </form>
325             </field>
326         </record>
327
328         <!--View for Products-->
329         <record model="ir.ui.view" id="products_tree_view">
330             <field name="name">Products Tree</field>
331             <field name="model">lunch.product</field>
332             <field name="type">tree</field>
333             <field name="arch" type="xml">
334                 <tree string="Products Tree">
335                     <field name="name"/>
336                     <field name="category_id"/>
337                     <field name="supplier"/>
338                     <field name="description"/>
339                     <field name="price"/>
340                     <field name="active"/>
341                 </tree>
342             </field>
343         </record>
344
345         <record model="ir.ui.view" id="products_form_view">
346             <field name="name">Products Form</field>
347             <field name="model">lunch.product</field>
348             <field name="type">form</field>
349             <field name="arch" type="xml">
350                 <form string="Products Form" version="7.0">
351                     <header>
352                     </header>
353                     <sheet>
354                         <group colspan="2" col="2">
355                             <field name='name'/>
356                             <field name='category_id'/>
357                             <field name='supplier'/>
358                             <field name='price'/>
359                             <field name='active'/>
360                         </group>
361                         <group colspan="2" col="2">
362                         </group>
363                         <group>
364                         <field name='description'/>
365                     </group>
366                     </sheet>
367                 </form>
368             </field>
369         </record>
370
371         <!--view for cashmove-->
372         <record model="ir.ui.view" id="casmove_tree_view">
373             <field name="name">cashmove tree</field>
374             <field name="model">lunch.cashmove</field>
375             <field name="type">tree</field>
376             <field name="arch" type="xml">
377                 <tree string="cashmove tree">
378                     <field name="date"/>
379                     <field name="user_id"/>
380                     <field name="description"/>
381                     <field name="amount" sum="Total"/>
382                 </tree>
383             </field>
384         </record>
385
386         <record model="ir.ui.view" id="casmove_form_view">
387             <field name="name">cashmove form</field>
388             <field name="model">lunch.cashmove</field>
389             <field name="type">form</field>
390             <field name="arch" type="xml">
391                 <form string="cashmove form" version="7.0">
392                     <header>
393                     </header>
394                     <sheet>
395                         <group colspan="2" col="2">
396                             <field name="user_id"/>
397                             <field name="date"/>
398                             <field name="amount"/>
399                         </group>
400                          <group colspan="2" col="2">
401                         </group>
402                         <group>
403                             <field name="description"/>
404                         </group>
405                     </sheet>
406                 </form>
407             </field>
408         </record>
409
410         <!--view for alerts-->
411         <record model="ir.ui.view" id="alert_tree_view">
412             <field name="name">alert tree</field>
413             <field name="model">lunch.alert</field>
414             <field name="type">tree</field>
415             <field name="arch" type="xml">
416                 <tree string="alert tree">
417                     <field name="message"/>
418                     <field name="day"/>
419                     <field name='active_from' widget='float_time'/>
420                     <field name='active_to' widget='float_time'/>
421                     <field name="lunch_active"/>
422                 </tree>
423             </field>
424         </record>
425
426         <record model="ir.ui.view" id="alert_form_view">
427             <field name="name">alert tree</field>
428             <field name="model">lunch.alert</field>
429             <field name="type">form</field>
430             <field name="arch" type="xml">
431                 <form string="alert tree" version="7.0">
432                     <header>
433                     </header>
434                     <sheet>
435                     <separator string="Schedule Date" colspan="4"/>
436                         <group col="2" colspan="2">
437                             <field name="day"/>
438                             <field name="specific" attrs="{'invisible': [('day','!=','specific')]}"/>
439                         </group>
440                         <group col="2" colspan="2">
441                         </group>
442                         <group col="2" attrs="{'invisible': [('day','!=','week')]}">
443                             <field name="monday"/>
444                             <field name="tuesday"/>
445                             <field name="wednesday"/>
446                             <field name="thursday"/>
447                         </group>
448                         <group col="2" attrs="{'invisible': [('day','!=','week')]}">
449                             <field name="friday"/>
450                             <field name="saturday"/>
451                             <field name="sunday"/>
452                         </group>
453                     <separator string="Schedule Hour" colspan="4"/>
454                     <group col="2" colspan="2">
455                         <field name='active_from' widget='float_time'/>
456                         <field name='active_to' widget='float_time'/>
457                     </group>
458                     <group col="2" colspan="2">
459                     </group>
460                     <separator string="Alert Informations" colspan="4"/>
461                      <group col="2" colspan="2">
462                         <field name='lunch_active'/>
463                         <field name='message' placeholder="Write the message you want to display during the defined period..."/>
464                     </group>
465                     <group col="2" colspan="2">
466                     </group>
467                 </sheet>
468                 </form>
469             </field>
470         </record>
471
472         <record model='ir.ui.view' id='partner_instructor_form_view'>
473             <field name='name'>partner.supplier.name.form</field>
474             <field name='model'>res.partner</field>
475             <field name='type'>form</field>
476             <field name='inherit_id' ref='base.view_partner_form' />
477             <field name='arch' type='xml'>
478                 <field name='title' position='after'>
479                     <field name='supplier_lunch'/>
480                 </field> 
481             </field>
482         </record>
483     </data>
484 </openerp>