4 <menuitem name="Lunch Order" parent="base.menu_tools"
5 id="menu_lunch" sequence="1" />
7 <menuitem name="Reporting" parent="base.menu_tools"
8 id="base.menu_lunch_reporting" sequence="6" groups="base.group_tool_manager"/>
10 <menuitem name="Lunch"
11 parent="base.menu_reporting"
12 id="menu_lunch_reporting_order" sequence="55" />
14 <menuitem name="Configuration" parent="base.menu_tools"
15 id="base.menu_lunch_survey_root" sequence="20" groups="base.group_tool_manager"/>
17 <menuitem name="Lunch" parent="base.menu_lunch_survey_root"
18 id="menu_lunch_category_root_configuration" sequence="1" />
20 <!-- Lunch order Form view -->
22 <record model="ir.ui.view" id="view_lunch_order_form">
23 <field name="name">Order</field>
24 <field name="model">lunch.order</field>
25 <field name="arch" type="xml">
28 <button name="%(action_lunch_order_confirm)d" string="Confirm Order" type="action" states="draft" class="oe_highlight"/>
29 <button name="%(action_lunch_order_cancel)d" string="Cancel Order" type="action" states="confirmed" class="oe_form_button_return_flow"/>
30 <field name="state" widget="statusbar" statusbar_visible="draft,confirmed"/>
32 <sheet string="Order">
34 <field name="user_id"/>
36 <field name="product" on_change="onchange_product(product)"/>
37 <field name="category"/>
38 <field name="descript"/>
40 <field name="cashmove"/>
47 <!-- Lunch order Tree view -->
49 <record model="ir.ui.view" id="view_lunch_order_tree">
50 <field name="name">Order</field>
51 <field name="model">lunch.order</field>
52 <field name="type">tree</field>
53 <field name="arch" type="xml">
54 <tree colors="blue:state == 'draft';black:state == 'confirmed'" string="Order">
56 <field name="user_id"/>
57 <field name="product"/>
58 <field name="descript"/>
59 <field name="category"/>
60 <field name="price" sum="Total price"/>
66 <!-- Lunch order Search view -->
68 <record id="view_lunch_order_filter" model="ir.ui.view">
69 <field name="name">lunch.order.list.select</field>
70 <field name="model">lunch.order</field>
71 <field name="type">search</field>
72 <field name="arch" type="xml">
73 <search string="Search Lunch Order">
74 <filter icon="terp-check" string="To Confirm" domain="[('state','=','draft')]"/>
75 <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=',('confirmed'))]"/>
76 <separator orientation="vertical"/>
77 <filter icon="terp-go-today" name="Today" string="Today" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
78 <separator orientation="vertical"/>
79 <field name="user_id"/>
82 <group expand="0" string="Group By...">
83 <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'category'}"/>
89 <!-- Lunch order Action -->
91 <record model="ir.actions.act_window" id="action_lunch_order_form">
92 <field name="name">Lunch 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_lunch_order_filter"/>
96 <field name="context">{"search_default_Today":1}</field>
99 <menuitem name="Lunch Orders" parent="menu_lunch"
100 id="menu_lunch_order_form" action="action_lunch_order_form" />
102 <!-- Cash Box Form view -->
104 <record model="ir.ui.view" id="view_lunch_cashbox_form">
105 <field name="name">Cashboxes</field>
106 <field name="model">lunch.cashbox</field>
107 <field name="arch" type="xml">
108 <form string="Cashboxes" version="7.0">
110 <field name="manager"/>
115 <!-- Cash Box Tree view -->
117 <record model="ir.ui.view" id="view_lunch_cashbox_tree">
118 <field name="name">Cashboxes</field>
119 <field name="model">lunch.cashbox</field>
120 <field name="type">tree</field>
121 <field name="arch" type="xml">
122 <tree string="Cashboxes" colors="red:sum_remain<=0">
124 <field name="manager"/>
125 <field name="sum_remain"/>
130 <!-- Cash Box Action -->
132 <record model="ir.actions.act_window" id="action_lunch_cashbox_form">
133 <field name="name"> Cashboxes </field>
134 <field name="res_model">lunch.cashbox</field>
137 <menuitem name="Cashboxes"
138 parent="menu_lunch_category_root_configuration"
139 id="menu_lunch_cashbox_form"
140 action="action_lunch_cashbox_form" />
142 <!-- Cash Move Form view -->
144 <record model="ir.ui.view" id="view_lunch_cashmove_form">
145 <field name="name">CashMove</field>
146 <field name="model">lunch.cashmove</field>
147 <field name="arch" type="xml">
148 <form string="CashMove" version="7.0">
151 <field name="user_cashmove"/>
152 <field name="amount"/>
154 <field name="create_date"/>
155 <field name="active"/>
161 <!-- Cash Move Tree view -->
163 <record model="ir.ui.view" id="view_lunch_cashmove_tree">
164 <field name="name">CashMove</field>
165 <field name="model">lunch.cashmove</field>
166 <field name="type">tree</field>
167 <field name="arch" type="xml">
168 <tree string="CashMove" editable="top">
169 <field name="create_date"/>
171 <field name="name" required="1"/>
172 <field name="user_cashmove"/>
173 <field name="amount" sum="Total amount"/>
178 <!-- Cash Move Search View -->
180 <record id="view_lunch_cashmove_filter" model="ir.ui.view">
181 <field name="name">lunch.cashmove.list.select</field>
182 <field name="model">lunch.cashmove</field>
183 <field name="type">search</field>
184 <field name="arch" type="xml">
185 <search string="Search CashMove">
186 <filter icon="terp-go-today" name="Today" string="Today" domain="[('create_date','<=',time.strftime('%%Y-%%m-%%d 23:59:59'))]"/>
187 <separator orientation="vertical"/>
188 <field name="user_cashmove"/>
189 <field name="create_date"/>
191 <group expand="0" string="Group By...">
192 <filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_cashmove'}"/>
193 <separator orientation="vertical"/>
194 <filter string="Box" icon="terp-dolar" domain="[]" context="{'group_by':'box'}"/>
195 <separator orientation="vertical"/>
196 <filter string="Date" icon="terp-go-today" domain="[]" context="{'group_by':'create_date'}"/>
203 <!-- Cash Move Action -->
205 <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
206 <field name="name">Cash Moves</field>
207 <field name="res_model">lunch.cashmove</field>
208 <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
209 <field name="context">{"search_default_Today":1}</field>
212 <menuitem name="Cash Moves" parent="menu_lunch"
213 id="menu_lunch_cashmove_form"
214 action="action_lunch_cashmove_form" />
216 <!-- Lunch Category Form view -->
218 <record model="ir.ui.view" id="view_lunch_category_form">
219 <field name="name"> Category of product </field>
220 <field name="model">lunch.category</field>
221 <field name="arch" type="xml">
222 <form string="Category" version="7.0">
223 <separator string="Category Related to Products" colspan="4"/>
229 <!-- Lunch Category Tree view -->
231 <record model="ir.ui.view" id="view_lunch_category_tree">
232 <field name="name">Category</field>
233 <field name="model">lunch.category</field>
234 <field name="type">tree</field>
235 <field name="arch" type="xml">
236 <tree string="Order">
242 <!-- Lunch Category Action -->
244 <record model="ir.actions.act_window" id="action_lunch_category_form">
245 <field name="name"> Product Categories </field>
246 <field name="res_model">lunch.category</field>
249 <!-- Lunch Product Form view -->
251 <record model="ir.ui.view" id="view_lunch_product_form">
252 <field name="name">Products</field>
253 <field name="type">form</field>
254 <field name="model">lunch.product</field>
255 <field name="arch" type="xml">
256 <form string="Products" version="7.0">
259 <field name="category_id"/>
260 <field name="price" />
262 <notebook colspan="4">
263 <page string="General Information">
264 <field name="active"/>
265 <separator string="Description" colspan="4" />
266 <field name="description" nolabel="1" colspan="4" />
273 <!-- Lunch Product Tree view -->
275 <record model="ir.ui.view" id="view_lunch_product_tree">
276 <field name="name">Products</field>
277 <field name="model">lunch.product</field>
278 <field name="type">tree</field>
279 <field name="arch" type="xml">
280 <tree string="Products">
282 <field name="category_id"/>
283 <field name="price"/>
284 <field name="description"/>
289 <!-- Lunch Product Search view -->
291 <record model="ir.ui.view" id="view_lunch_product_search">
292 <field name="name">Products</field>
293 <field name="model">lunch.product</field>
294 <field name="type">search</field>
295 <field name="arch" type="xml">
296 <search string="Products">
297 <field name="name" />
298 <field name="category_id"/>
299 <field name="price"/>
304 <!-- Lunch Product Action -->
306 <record model="ir.actions.act_window" id="action_lunch_product_form">
307 <field name="name">Products</field>
308 <field name="res_model">lunch.product</field>
309 <field name="view_type">form</field>
310 <field name="view_mode">tree,form</field>
311 <field name="view_id" ref="view_lunch_product_tree"/>
312 <field name="search_view_id" ref="view_lunch_product_search"/>
315 <menuitem name="Products"
316 parent="menu_lunch_category_root_configuration"
317 id="menu_lunch_product_form" action="action_lunch_product_form"
320 <menuitem name="Product Categories"
321 parent="menu_lunch_category_root_configuration"
322 id="menu_lunch_category_form"
323 action="action_lunch_category_form" sequence="1" />
326 <!-- Lunch Amount Tree view -->
328 <record model="ir.ui.view" id="view_report_lunch_amount_tree">
329 <field name="name">Lunch amount</field>
330 <field name="model">report.lunch.amount</field>
331 <field name="type">tree</field>
332 <field name="arch" type="xml">
333 <tree string="Box Amount by User">
334 <field name="date" invisible="1"/>
335 <field name="year" invisible="1"/>
336 <field name="day" invisible="1"/>
337 <field name="month" invisible="1"/>
339 <field name="user_id"/>
340 <field name="amount" sum="Total box" />
345 <!-- Lunch Amount Form view -->
347 <record model="ir.ui.view" id="view_report_lunch_amount_form">
348 <field name="name">Lunch amount</field>
349 <field name="model">report.lunch.amount</field>
350 <field name="type">form</field>
351 <field name="arch" type="xml">
352 <form string="Box Amount by User" version="7.0">
355 <field name="user_id"/>
357 <field name="amount"/>
364 <!-- Lunch Amount Search view -->
366 <record model="ir.ui.view" id="view_report_lunch_amount_search">
367 <field name="name">Lunch amount</field>
368 <field name="model">report.lunch.amount</field>
369 <field name="type">search</field>
370 <field name="arch" type="xml">
371 <search string="Box Amount by User">
373 <filter icon="terp-go-year" string=" Year " name="year"
374 domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]"
375 help="Box amount in current year"/>
376 <separator orientation="vertical"/>
378 <filter icon="terp-go-month" string=" Month "
380 domain="[('date','<=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
381 help="Box amount in current month"/>
382 <filter icon="terp-go-month"
384 domain="[('date','<=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
385 help="Box amount in last month"/>
386 <separator orientation="vertical"/>
387 <field name="user_id"/>
389 <field name="amount"/>
392 <group expand="0" string="Group By...">
393 <filter string="Box" icon="terp-dolar" context="{'group_by':'box'}"/>
399 <!-- Lunch Amount Action -->
401 <record model="ir.actions.act_window" id="action_report_lunch_amount_tree">
402 <field name="name">Cash Position by User</field>
403 <field name="res_model">report.lunch.amount</field>
404 <field name="view_type">form</field>
405 <field name="view_mode">tree,form</field>
406 <field name="context">{'search_default_year': 1,"search_default_month":1}</field>
407 <field name="search_view_id" ref="view_report_lunch_amount_search"/>
410 <menuitem name="Cash Position by User"
411 parent="menu_lunch_reporting_order"
412 action="action_report_lunch_amount_tree"
413 id="menu_lunch_report_amount_tree" />