[MERGE] lp:~openerp-dev/openobject-addons/trunk-pos-fva
[odoo/odoo.git] / addons / point_of_sale / point_of_sale_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4         <menuitem name="PoS Backend" id="menu_point_root" sequence="20"
5             icon="terp-partner"
6             groups="group_pos_manager"
7             web_icon="images/pos.png"
8             web_icon_hover="images/pos-hover.png"/>
9
10         <record id="categ_others" model="pos.category">
11           <field name="name">Others</field>
12         </record>
13
14         <record model="ir.ui.view" id="view_pos_pos_form">
15             <field name="name">pos.order</field>
16             <field name="model">pos.order</field>
17             <field name="type">form</field>
18             <field name="arch" type="xml">
19                 <form string="PoS Orders">
20                     <group col="7" colspan="4">
21                         <field name="name"/>
22                         <field name="date_order"/>
23                         <field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_customer':1}" attrs="{'readonly': [('state','=','invoiced')]}"/>
24                         <button name="action_invoice" string="Invoice" icon="gtk-apply" type="object" states="paid" attrs="{'readonly': [('partner_id','=',False)]}"/>
25                     </group>
26                     <notebook colspan="4">
27                         <page string="Sale Order">
28                             <field name="lines" colspan="4" nolabel="1">
29                                 <tree string="Order lines" editable="bottom">
30                                     <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
31                                     <field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>
32                                     <field name="price_unit" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>
33                                     <field name="discount"  on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>
34                                     <field name="price_subtotal"/>
35                                     <field name="price_subtotal_incl"/>
36                                 </tree>
37                                 <form string="Order lines">
38                                     <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
39                                     <field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>
40                                     <field name="discount"  on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>
41                                     <field name="price_unit" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>
42                                     <field name="price_subtotal" invisible="1"/>
43                                     <field name="price_subtotal_incl" invisible="1"/>
44                                     <field name="notice"/>
45                                 </form>
46                             </field>
47                             <group colspan="4" col="7">
48                                 <field name="amount_tax"/>
49                                 <field name="amount_total"/>
50                                 <button name="button_dummy" string="Update" icon="gtk-execute" states="draft" />
51                                 <button name="%(action_pos_discount)d" string="Discount" icon="gtk-remove" type="action" states="draft" />
52                             </group>
53
54                             <separator colspan="4"/>
55                             <group colspan="4" col="8">
56                                 <field name="state" widget="statusbar" statusbar_visible="draft,paid,done" statusbar_colors='{"cancel":"red"}'/>
57                                 <button name="%(action_pos_payment)d" string="Payment" icon="gtk-apply" type="action" states="draft"/>
58                                 <button name="refund" string="Return Products" type="object" icon="gtk-ok"
59                                     attrs="{'invisible':[('state','=','draft')]}"/>
60                                 <button name="%(action_report_pos_receipt)d" string="Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
61                             </group>
62                         </page>
63                         <page string="Payment">
64                             <field name="statement_ids" colspan="4" nolabel="1">
65                                 <tree editable="bottom" string="Statement lines">
66                                     <field name="journal_id"/>
67                                     <field name="statement_id" />
68                                     <field name="amount"/>
69                                 </tree>
70                                 <form string="Statement lines">
71                                     <field name="account_id"/>
72                                     <field name="amount"/>
73                                     <field name="statement_id" domain="[('company_id','=',parent.company_id),('state','=','open')]"/>
74                                 </form>
75                             </field>
76                         </page>
77                         <page string="Extra Info" groups="base.group_extended">
78                             <group colspan="2" col="2">
79                                 <separator string="General Information" colspan="2"/>
80                                 <field name="company_id" groups="base.group_multi_company"/>
81                                 <field name="shop_id" widget="selection"/>
82                                 <field name="user_id"/>
83                                 <field name="pricelist_id" groups="product.group_sale_pricelist" domain="[('type','=','sale')]"/>
84                                 <field name="picking_id" readonly="1" groups="base.group_extended"/>
85                             </group>
86                             <group colspan="2" col="3">
87                                 <separator string="Accounting Information" colspan="3"/>
88                                 <field name="sale_journal" domain="[('type','=','sale')]"/>
89                                 <button name="done" string="Post Entries" icon="gtk-apply" type="workflow" states="paid"/>
90                                 <field name="invoice_id" colspan="2" readonly="1"
91                                     attrs="{'invisible':[('state','&lt;&gt;','invoiced')]}"/>
92                                 <button name="%(pos_invoice_report)d" string="Re-Print"
93                                     icon="gtk-print" type="action" attrs="{'invisible':[('state','&lt;&gt;','invoiced')]}"/>
94                                 <field name="account_move" colspan="3" readonly="1"
95                                     attrs="{'invisible':[('state','&lt;&gt;','done')]}"/>
96                             </group>
97                         </page>
98                         <page string="Notes" >
99                             <field colspan="4" name="note" nolabel="1"/>
100                         </page>
101                     </notebook>
102                 </form>
103             </field>
104         </record>
105         <record model="ir.actions.act_window" id="action_pos_pos_form">
106             <field name="name">PoS Orders</field>
107             <field name="type">ir.actions.act_window</field>
108             <field name="res_model">pos.order</field>
109             <field name="view_type">form</field>
110             <field name="view_mode">tree,form</field>
111             <field name="view_id" eval="False"/>
112             <field name="domain">[]</field>
113         </record>
114         <record model="ir.ui.view" id="view_pos_order_tree">
115             <field name="name">Sales</field>
116             <field name="model">pos.order</field>
117             <field name="type">tree</field>
118             <field name="arch" type="xml">
119                 <tree string="POS Orders" colors="blue:state == 'draft';gray:state in ('done','cancel');black:state not in('done','cancel')">
120                     <field name="name"/>
121                     <field name="partner_id"/>
122                     <field name="date_order"/>
123                     <field name="user_id"/>
124                     <field name="invoice_id"/>
125                     <field name="amount_total" sum="Amount total"/>
126                     <field name="company_id" groups="base.group_multi_company"/>
127                     <field name="state"/>
128                 </tree>
129             </field>
130         </record>
131         <record id="view_pos_order_filter" model="ir.ui.view">
132             <field name="name">pos.order.list.select</field>
133             <field name="model">pos.order</field>
134             <field name="type">search</field>
135             <field name="arch" type="xml">
136                 <search string="Search Sales Order">
137                     <filter icon="terp-document-new" string="New" domain="[('state','=','draft')]"/>
138                     <filter icon="gtk-apply" string="Done" domain="[('state','in',('paid','invoiced','done'))]"/>
139                     <separator orientation="vertical"/>
140                     <filter icon="terp-check" string="Invoiced" domain="[('state','=','invoiced')]"/>
141                     <filter icon="gtk-convert" string="Posted" domain="[('state','=','done')]"/>
142                     <separator orientation="vertical"/>
143                     <filter icon="terp-go-month" string="Today" domain="[('date_order','&gt;=',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&lt;=',datetime.date.today().strftime('%%Y-%%m-%%d 23:59:59'))]"/>
144                     <filter icon="gtk-go-forward" string="Yesterday" domain="[('date_order','&lt;',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&gt;=',(datetime.date.today() - relativedelta(days=1)).strftime('%%Y-%%m-%%d 00:00:00'))]"/>
145                     <separator orientation="vertical"/>
146                     <field name="name"/>
147                     <field name="user_id"/>
148                     <newline/>
149                     <group expand="0" string="Group By..." groups="base.group_extended">
150                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
151                         <filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
152                         <separator string="" orientation="vertical"/>
153                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
154                         <separator string="" orientation="vertical"/>
155                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
156                     </group>
157                </search>
158             </field>
159         </record>
160
161         <menuitem name="Daily Operations" id="menu_point_of_sale" parent="menu_point_root" sequence="10" />
162         <menuitem parent="menu_point_of_sale" id="menu_point_ofsale" action="action_pos_pos_form" sequence="1" groups="group_pos_manager,group_pos_user"/>
163         <menuitem name="Products" id="menu_point_of_sale_product" parent="menu_point_root" sequence="15" />
164
165         <record id="product_normal_action" model="ir.actions.act_window">
166             <field name="name">Products</field>
167             <field name="type">ir.actions.act_window</field>
168             <field name="res_model">product.product</field>
169             <field name="view_type">form</field>
170             <field name="view_mode">tree,form,kanban</field>
171             <field name="context" eval="{'default_pos_categ_id': ref('point_of_sale.categ_others')}"/>
172             <field name="view_id" ref="product.product_product_tree_view"/>
173             <field name="search_view_id" ref="product.product_search_form_view"/>
174             <field name="help">You must define a Product for everything you buy or sell. Products can be raw materials, stockable products, consumables or services. The Product form contains detailed information about your products related to procurement logistics, sales price, product category, suppliers and so on.</field>
175         </record>
176         <menuitem
177             action="product_normal_action"
178             id="menu_pos_products"
179             parent="menu_point_of_sale_product" sequence="2"/>
180
181         <record model="ir.ui.view" id="view_pos_order_line">
182             <field name="name">Sale lines</field>
183             <field name="model">pos.order.line</field>
184             <field name="type">tree</field>
185             <field name="arch" type="xml">
186                 <tree string="POS Order lines">
187                     <field name="product_id" readonly="1"/>
188                     <field name="qty" readonly="1" sum="Total qty"/>
189                     <field name="discount" readonly="1"/>
190                     <field name="price_unit" readonly="1"/>
191                     <field name="price_subtotal" readonly="1" sum="Sum of subtotals"/>
192                     <field name="price_subtotal_incl" readonly="1" sum="Sum of subtotals"/>
193                     <field name="create_date" readonly="1"/>
194                 </tree>
195             </field>
196         </record>
197
198         <record model="ir.ui.view" id="view_pos_order_line_form">
199             <field name="name">Sale line</field>
200             <field name="model">pos.order.line</field>
201             <field name="type">form</field>
202             <field name="arch" type="xml">
203                 <form string="POS Order line">
204                     <field name="product_id" />
205                     <field name="qty" />
206                     <field name="discount" />
207                     <field name="price_unit" />
208                     <field name="create_date" />
209                 </form>
210             </field>
211         </record>
212
213         <record model="ir.actions.act_window" id="action_pos_order_line">
214             <field name="name">Sale line</field>
215             <field name="type">ir.actions.act_window</field>
216             <field name="res_model">pos.order.line</field>
217             <field name="view_type">form</field>
218             <field name="view_mode">tree</field>
219             <field name="view_id" ref="view_pos_order_line"/>
220         </record>
221
222         <record model="ir.actions.act_window" id="action_pos_order_line_form">
223             <field name="name">Sale line</field>
224             <field name="type">ir.actions.act_window</field>
225             <field name="res_model">pos.order.line</field>
226             <field name="view_type">form</field>
227             <field name="view_mode">form,tree</field>
228             <field name="view_id" ref="view_pos_order_line_form"/>
229         </record>
230
231         <record model="ir.actions.act_window" id="action_pos_order_line_day">
232             <field name="name">Sale line</field>
233             <field name="type">ir.actions.act_window</field>
234             <field name="res_model">pos.order.line</field>
235             <field name="view_type">form</field>
236             <field name="view_mode">tree</field>
237             <field name="view_id" ref="view_pos_order_line"/>
238             <field name="domain">[('create_date', '&gt;=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '&lt;=', time.strftime('%Y-%m-%d 23:59:59'))]</field>
239         </record>
240
241
242
243         <!-- report -->
244
245         <record model="ir.ui.view" id="view_pos_trans_user_form">
246             <field name="name">report.trans.pos.user.form</field>
247             <field name="model">report.transaction.pos</field>
248             <field name="type">form</field>
249             <field name="arch" type="xml">
250                 <form string="POS ">
251                     <field name="user_id"/>
252                     <field name="journal_id"/>
253                     <field name="jl_id"/>
254                     <field name="date_create" widget="date"/>
255                     <field name="no_trans"/>
256                     <field name="amount"/>
257                     <field name="invoice_id"/>
258                 </form>
259             </field>
260         </record>
261
262
263         <record model="ir.ui.view" id="view_trans_pos_user_tree">
264             <field name="name">Sales by user</field>
265             <field name="model">report.transaction.pos</field>
266             <field name="type">tree</field>
267             <field name="arch" type="xml">
268                 <tree string="POS">
269                     <field name="date_create" widget="date" />
270                     <field name="user_id"/>
271                     <field name="journal_id"/>
272                     <field name="jl_id"/>
273                     <field name="no_trans" sum="Total Transaction"/>
274                     <field name="amount" sum="Amount total"/>
275                     <field name="product_nb" />
276                     <field name="invoice_id"/>
277                     <field name="disc"/>
278                 </tree>
279             </field>
280         </record>
281
282         <record model="ir.ui.view" id="view_report_transaction_pos_calendar">
283             <field name="name">report.transaction.pos.calendar</field>
284             <field name="model">report.transaction.pos</field>
285             <field name="type">calendar</field>
286             <field eval="2" name="priority"/>
287             <field name="arch" type="xml">
288                 <calendar color="user_id" date_start="date_create" string="POS Report">
289                     <field name="journal_id"/>
290                     <field name="amount"/>
291                 </calendar>
292             </field>
293          </record>
294
295          <record model="ir.ui.view" id="view_report_transaction_pos_graph">
296             <field name="name">report.transaction.pos.graph</field>
297             <field name="model">report.transaction.pos</field>
298             <field name="type">graph</field>
299             <field eval="2" name="priority"/>
300             <field name="arch" type="xml">
301                 <graph  type="bar" string="POS Report">
302                     <field name="user_id" />
303                     <field name="amount"/>
304                     <field group="True" name="journal_id"/>
305                 </graph>
306             </field>
307          </record>
308
309         <record model="ir.actions.act_window" id="action_trans_pos_tree_today">
310             <field name="name">Sales by day</field>
311             <field name="res_model">report.transaction.pos</field>
312             <field name="view_type">form</field>
313             <field name="view_mode">tree,calendar,form,graph</field>
314             <field name="domain">[('date_create','=',time.strftime('%Y-%m-%d'))]</field>
315         </record>
316
317
318         <record model="ir.actions.act_window" id="action_trans_pos_tree_month">
319             <field name="name">Sales by month</field>
320             <field name="res_model">report.transaction.pos</field>
321             <field name="view_type">form</field>
322             <field name="view_mode">tree,calendar,form,graph</field>
323             <field name="domain">[('date_create','like',time.strftime('%Y-%m'))]</field>
324         </record>
325
326
327         <record model="ir.actions.act_window" id="action_trans_pos_tree">
328             <field name="name">Sales by user</field>
329             <field name="res_model">report.transaction.pos</field>
330             <field name="view_type">form</field>
331             <field name="view_mode">tree,calendar,form,graph</field>
332             <field name="view_id" ref="view_trans_pos_user_tree"/>
333         </record>
334
335
336         <record model="ir.ui.view" id="view_report_sales_by_user_pos_form">
337             <field name="name">report.sales.by.user.pos.form</field>
338             <field name="model">report.sales.by.user.pos</field>
339             <field name="type">form</field>
340             <field name="arch" type="xml">
341                 <form string="POS ">
342                     <field name="date_order" widget="date"/>
343                     <field name="qty"/>
344                     <field name="amount"/>
345                     <field name="user_id"/>
346                 </form>
347             </field>
348         </record>
349
350
351         <record model="ir.ui.view" id="view_report_sales_by_user_pos_tree">
352             <field name="name">report.sales.by.user.pos.tree</field>
353             <field name="model">report.sales.by.user.pos</field>
354             <field name="type">tree</field>
355             <field name="arch" type="xml">
356                 <tree string="POS">
357                     <field name="date_order" widget="date"/>
358                     <field name="qty"/>
359                     <field name="amount"/>
360                     <field name="user_id"/>
361                 </tree>
362             </field>
363         </record>
364
365         <record model="ir.ui.view" id="view_report_sales_by_user_pos_calendar">
366             <field name="name">report.sales.by.user.pos.calendar</field>
367             <field name="model">report.sales.by.user.pos</field>
368             <field name="type">calendar</field>
369             <field eval="2" name="priority"/>
370             <field name="arch" type="xml">
371                 <calendar color="user_id" date_start="date_order" string="POS Report">
372                     <field name="qty"/>
373                     <field name="amount" />
374                 </calendar>
375             </field>
376          </record>
377
378         <record model="ir.ui.view" id="view_report_sales_by_user_pos_graph">
379             <field name="name">report.sales.by.user.pos.graph</field>
380             <field name="model">report.sales.by.user.pos</field>
381             <field name="type">graph</field>
382             <field eval="2" name="priority"/>
383             <field name="arch" type="xml">
384                 <graph  type="bar" string="Sales by User">
385                     <field name="user_id" />
386                     <field name="amount"/>
387                 </graph>
388             </field>
389          </record>
390
391          <record model="ir.actions.act_window" id="action_report_sales_by_user_pos_today">
392             <field name="name">Sales by User</field>
393             <field name="res_model">report.sales.by.user.pos</field>
394             <field name="view_type">form</field>
395             <field name="view_mode">tree,calendar,form,graph</field>
396             <field name="domain">[('date_order','=',time.strftime('%Y-%m-%d'))]</field>
397          </record>
398
399
400         <!-- Sales of user by month -->
401
402         <record model="ir.ui.view" id="view_report_sales_by_user_pos_month_form">
403             <field name="name">report.sales.by.user.pos.month.form</field>
404             <field name="model">report.sales.by.user.pos.month</field>
405             <field name="type">form</field>
406             <field name="arch" type="xml">
407                 <form string="POS ">
408                     <field name="date_order" widget="date"/>
409                     <field name="qty"/>
410                     <field name="amount"/>
411                     <field name="user_id"/>
412                 </form>
413             </field>
414         </record>
415
416
417         <record model="ir.ui.view" id="view_report_sales_by_user_pos_month_tree">
418             <field name="name">report.sales.by.user.pos.month.tree</field>
419             <field name="model">report.sales.by.user.pos.month</field>
420             <field name="type">tree</field>
421             <field name="arch" type="xml">
422                 <tree string="POS">
423                     <field name="date_order" widget="date"/>
424                     <field name="qty"/>
425                     <field name="amount"/>
426                     <field name="user_id"/>
427                 </tree>
428             </field>
429         </record>
430
431         <record model="ir.ui.view" id="view_report_sales_by_user_pos_month_calendar">
432             <field name="name">report.sales.by.user.pos.month.calendar</field>
433             <field name="model">report.sales.by.user.pos.month</field>
434             <field name="type">calendar</field>
435             <field eval="2" name="priority"/>
436             <field name="arch" type="xml">
437                 <calendar color="user_id" date_start="date_order" string="POS Report">
438                     <field name="qty"/>
439                     <field name="amount" />
440                 </calendar>
441             </field>
442          </record>
443
444         <record model="ir.ui.view" id="view_report_sales_by_user_pos_month_graph">
445             <field name="name">report.sales.by.user.pos.month.graph</field>
446             <field name="model">report.sales.by.user.pos.month</field>
447             <field name="type">graph</field>
448             <field eval="2" name="priority"/>
449             <field name="arch" type="xml">
450                 <graph  type="bar" string="Sales by User">
451                     <field name="user_id" />
452                     <field name="amount"/>
453                 </graph>
454             </field>
455          </record>
456
457
458          <record model="ir.actions.act_window" id="action_report_sales_by_user_pos_month">
459             <field name="name">Sales by User Monthly</field>
460             <field name="res_model">report.sales.by.user.pos.month</field>
461             <field name="view_type">form</field>
462             <field name="view_mode">tree,calendar,form,graph</field>
463             <field name="domain">[('date_order','like',time.strftime('%Y-%m'))]</field>
464         </record>
465
466         <!-- Sales by margin -->
467
468         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_form">
469             <field name="name">report.sales.by.margin.pos.form</field>
470             <field name="model">report.sales.by.margin.pos</field>
471             <field name="type">form</field>
472             <field name="arch" type="xml">
473                 <form string="POS ">
474                     <field name="user_id"/>
475                     <field name="product_name"/>
476                     <field name="date_order" widget="date"/>
477                     <field name="qty"/>
478                     <field name="net_margin_per_qty"/>
479                     <field name="total"/>
480                 </form>
481             </field>
482         </record>
483
484
485         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_tree">
486             <field name="name">report.sales.by.margin.pos.tree</field>
487             <field name="model">report.sales.by.margin.pos</field>
488             <field name="type">tree</field>
489             <field name="arch" type="xml">
490                 <tree string="POS">
491                     <field name="user_id"/>
492                     <field name="product_name"/>
493                     <field name="date_order" widget="date"/>
494                     <field name="qty"/>
495                     <field name="net_margin_per_qty"/>
496                     <field name="total"/>
497                 </tree>
498             </field>
499         </record>
500
501         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_calendar">
502             <field name="name">report.sales.by.margin.pos.calendar</field>
503             <field name="model">report.sales.by.margin.pos</field>
504             <field name="type">calendar</field>
505             <field eval="2" name="priority"/>
506             <field name="arch" type="xml">
507                 <calendar color="user_id" date_start="date_order" string="Sales by User Margin">
508                     <field name="product_name"/>
509                     <field name="total" />
510                 </calendar>
511             </field>
512          </record>
513
514         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_graph">
515             <field name="name">report.sales.by.margin.pos.graph</field>
516             <field name="model">report.sales.by.margin.pos</field>
517             <field name="type">graph</field>
518             <field eval="2" name="priority"/>
519             <field name="arch" type="xml">
520                 <graph  type="bar" string="Sales by User Margin" orientation="horizontal">
521                     <field name="product_name" />
522                     <field name="total" operator="+"/>
523                 </graph>
524             </field>
525          </record>
526
527         <record model="ir.actions.act_window" id="action_report_sales_by_margin_pos_today">
528             <field name="name">Sales by User Daily margin</field>
529             <field name="res_model">report.sales.by.margin.pos</field>
530             <field name="view_type">form</field>
531             <field name="view_mode">tree,calendar,form,graph</field>
532             <field name="domain">[('date_order','=',time.strftime('%Y-%m-%d'))]</field>
533          </record>
534
535          <record model="ir.ui.view" id="view_report_sales_by_margin_pos_month_form">
536             <field name="name">report.sales.by.margin.pos.month.form</field>
537             <field name="model">report.sales.by.margin.pos.month</field>
538             <field name="type">form</field>
539             <field name="arch" type="xml">
540                 <form string="POS ">
541                     <field name="user_id"/>
542                     <field name="product_name"/>
543                     <field name="date_order" widget="date"/>
544                     <field name="qty"/>
545                     <field name="net_margin_per_qty"/>
546                     <field name="total"/>
547                 </form>
548             </field>
549         </record>
550
551
552         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_month_tree">
553             <field name="name">report.sales.by.margin.pos.month.tree</field>
554             <field name="model">report.sales.by.margin.pos.month</field>
555             <field name="type">tree</field>
556             <field name="arch" type="xml">
557                 <tree string="POS">
558                     <field name="user_id"/>
559                     <field name="product_name"/>
560                     <field name="date_order" widget="date"/>
561                     <field name="qty"/>
562                     <field name="net_margin_per_qty"/>
563                     <field name="total"/>
564                 </tree>
565             </field>
566         </record>
567
568         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_month_calendar">
569             <field name="name">report.sales.by.margin.pos.month.calendar</field>
570             <field name="model">report.sales.by.margin.pos.month</field>
571             <field name="type">calendar</field>
572             <field eval="2" name="priority"/>
573             <field name="arch" type="xml">
574                 <calendar color="user_id" date_start="date_order" string="Sales by User Margin">
575                     <field name="product_name"/>
576                     <field name="total" />
577                 </calendar>
578             </field>
579          </record>
580
581         <record model="ir.ui.view" id="view_report_sales_by_margin_pos_month_graph">
582             <field name="name">report.sales.by.margin.pos.month.graph</field>
583             <field name="model">report.sales.by.margin.pos.month</field>
584             <field name="type">graph</field>
585             <field eval="2" name="priority"/>
586             <field name="arch" type="xml">
587                 <graph  type="bar" string="Sales by User Margin" orientation="horizontal">
588                     <field name="product_name" />
589                     <field name="total" operator="+"/>
590                 </graph>
591             </field>
592          </record>
593
594          <record model="ir.actions.act_window" id="action_report_sales_by_margin_pos_month">
595             <field name="name">Sales by User Monthly margin</field>
596             <field name="res_model">report.sales.by.margin.pos.month</field>
597             <field name="view_type">form</field>
598             <field name="view_mode">tree,calendar,form,graph</field>
599             <field name="domain">[('date_order','like',time.strftime('%Y-%m'))]</field>
600         </record>
601
602         <record id="product_normal_form_pos_view" model="ir.ui.view">
603             <field name="name">product.normal.pos.form.inherit</field>
604             <field name="model">product.product</field>
605             <field name="type">form</field>
606             <field name="inherit_id" ref="product.product_normal_form_view"/>
607             <field name="arch" type="xml">
608                   <group name="status" position="after">
609                       <group colspan="2" col="2" name="pos">
610                           <separator string="Point-of-Sale" colspan="2"/>
611                           <field name="pos_categ_id"/>
612                       </group>
613                   </group>
614             </field>
615         </record>
616
617
618         <record id="product_normal_form_view" model="ir.ui.view">
619             <field name="name">product.normal.form.inherit</field>
620             <field name="model">product.product</field>
621             <field name="type">form</field>
622             <field name="inherit_id" ref="product.product_normal_form_view"/>
623             <field name="arch" type="xml">
624                   <field name="company_id" position="after">
625                   <separator string="Point of Sale" colspan="2"/>
626                       <field name="income_pdt"/>
627                       <field name="expense_pdt"/>
628                   </field>
629             </field>
630         </record>
631
632         <!-- Categories tree view -->
633         <record id="pos_category_form_view" model="ir.ui.view">
634             <field name="name">pos.category.form</field>
635             <field name="model">pos.category</field>
636             <field name="type">form</field>
637             <field name="arch" type="xml">
638                 <form string="PoS Categories">
639                     <group colspan="4" col="6">
640                         <field name="name"/>
641                         <field name="parent_id"/>
642                         <field name="sequence"/>
643                     </group>
644                 </form>
645             </field>
646         </record>
647         <record id="pos_category_tree_view" model="ir.ui.view">
648             <field name="name">pos.category.tree</field>
649             <field name="model">pos.category</field>
650             <field name="type">tree</field>
651             <field name="field_parent" eval="False"/>
652             <field name="arch" type="xml">
653                 <tree string="PoS Categories">
654                     <field name="sequence" invisible="1"/>
655                     <field name="complete_name"/>
656                 </tree>
657             </field>
658         </record>
659         <record id="pos_category_action" model="ir.actions.act_window">
660             <field name="name">PoS Categories</field>
661             <field name="type">ir.actions.act_window</field>
662             <field name="res_model">pos.category</field>
663             <field name="view_type">form</field>
664             <field name="view_mode">tree,form</field>
665             <field name="view_id" eval="False"/>
666         </record>
667         <menuitem action="pos_category_action" id="menu_pos_category" parent="menu_point_of_sale_product" sequence="0" />
668         <!-- END -->
669
670         <menuitem name="Configuration" parent="menu_point_root"
671             id="menu_point_config_product" sequence="25" groups="group_pos_manager"/>
672
673         <menuitem
674             parent="menu_point_of_sale"
675             action="action_box_entries"
676             id="menu_wizard_enter_jrnl" sequence="2" />
677
678         <menuitem
679             parent="menu_point_of_sale"
680             action="action_box_out"
681             id="menu_wizard_enter_jrnl2" sequence="3" />
682
683         <record id="action_account_journal_form" model="ir.actions.act_window">
684             <field name="name">Payment Methods</field>
685             <field name="res_model">account.journal</field>
686             <field name="view_type">form</field>
687             <field name="view_mode">tree,form</field>
688             <field name="context" eval="{'default_journal_user': 1, 'default_view_id': ref('account.account_journal_bank_view'), 'default_type': 'cash'}"/>
689             <field name="domain">[('journal_user','=', 1)]</field>
690             <field name="help">Payment methods are defined by accounting journals having the field Payment Method checked.</field>
691         </record>
692
693         <menuitem action="action_account_journal_form"
694             id="menu_action_account_journal_form_open"
695             parent="menu_point_config_product"
696             sequence="20"/>
697
698         <record model="ir.ui.view" id="view_pos_order_tree_all_sales_lines">
699             <field name="name">POS Sales Lines</field>
700             <field name="model">pos.order.line</field>
701             <field name="type">tree</field>
702             <field name="arch" type="xml">
703                 <tree string="POS Orders lines">
704                     <field name="order_id" />
705                     <field name="create_date" />
706                     <field name="product_id" />
707                     <field name="qty" />
708                     <field name="price_unit" />
709                 </tree>
710             </field>
711         </record>
712          <record model="ir.actions.act_window" id="action_pos_all_sales_lines">
713             <field name="name">All sales lines</field>
714             <field name="type">ir.actions.act_window</field>
715             <field name="res_model">pos.order.line</field>
716             <field name="view_type">form</field>
717             <field name="view_id" ref="view_pos_order_tree_all_sales_lines" />
718         </record>
719
720         <!--  Miscelleanous Operations/Reporting -->
721         <menuitem name="Point of Sale" parent="base.menu_reporting" id="menu_point_rep" sequence="50" groups="group_pos_manager"/>
722         <!-- Invoice -->
723
724         <record model="ir.actions.act_window" id="action_pos_sale_all">
725             <field name="name">All Sales Orders</field>
726             <field name="type">ir.actions.act_window</field>
727             <field name="res_model">pos.order</field>
728             <field name="view_type">form</field>
729             <field name="view_mode">tree,form</field>
730             <field name="domain">[]</field>
731         </record>
732         <menuitem parent="menu_point_rep" id="menu_point_ofsale_all" action="action_pos_sale_all" sequence="1"/>
733
734         <record model="ir.actions.act_window" id="action_pos_invoice">
735             <field name="name">Invoices</field>
736             <field name="type">ir.actions.act_window</field>
737             <field name="res_model">account.invoice</field>
738             <field name="view_type">form</field>
739             <field name="view_mode">tree,form</field>
740             <field name="domain">[('origin','like','POS')]</field>
741         </record>
742
743                 <menuitem name="Reporting" id="menu_point_of_sale_reporting" parent="menu_point_root" sequence="20" />
744                 
745         <menuitem icon="STOCK_PRINT" action="action_report_pos_details"
746                 id="menu_pos_details" parent="menu_point_of_sale_reporting" sequence="6" />
747
748         <record model="ir.actions.client" id="action_pos_pos">
749             <field name="name">Start Point of Sale</field>
750             <field name="tag">pos.ui</field>
751         </record>
752
753         <record id="menu_point_root_touchscreen" model="ir.ui.menu">
754           <field name="name">Point of Sale</field>
755           <field name="sequence" eval="21"/>
756           <field name="action" ref="action_pos_pos"/>
757         </record>
758
759         <!-- use menuitem to add web_icon and web_icon_hover above -->
760         <menuitem id="menu_point_root_touchscreen"
761             web_icon="images/pos.png" web_icon_hover="images/pos-hover.png" groups="point_of_sale.group_pos_manager,point_of_sale.group_pos_user"/>
762
763         <record model="ir.ui.view" id="view_pos_config_form">
764             <field name="name">pos.config.form.view</field>
765             <field name="model">pos.config</field>
766             <field name="type">form</field>
767             <field name="arch" type="xml">
768                 <form string="PoS Configuration">
769                     <field name="name" />
770                     <notebook colspan="4">
771                         <page string="Payment Methods">
772                             <field name="journal_ids" colspan="4" nolabel="1"/>
773                         </page>
774                         <page string="Accounting">
775                             <separator string="Accounting" colspan="4" />
776                             <field name="shop_id" widget="selection" />
777                             <field name="journal_id" widget="selection" />
778
779                             <separator string="Cash Differences" colspan="4" />
780                             <field name="profit_account_id" />
781                             <field name="loss_account_id" />
782                             <field name="authorized_cashbox_diff" />
783                             <field name="authorized_cashbox_diff_fixed" />
784
785                         </page>
786                         <page string="Interfaces">
787                             <field name="iface_self_checkout" />
788                             <field name="iface_websql" />
789                             <field name="iface_led" />
790                             <field name="iface_cashdrawer" />
791                             <field name="iface_payment_terminal" />
792                             <field name="iface_electronic_scale" />
793                             <field name="iface_barscan" />
794                             <field name="iface_vkeyboard" />
795                         </page>
796                         <page string="Other">
797                             <field name="sequence_id" />
798                         </page>
799
800
801                     </notebook>
802
803                     <group colspan="4" col="6">
804                         <field name="state" widget="statusbar" statusbar_visible="draft,active,inactive,deprecated" statusbar_colors='{"active":"green", "deprecated" : "red"}'/>
805                         <button string="Set to Draft" name="set_draft" type="object" states="deprecated"/>
806                         <button string="Set to Active" name="set_active" type="object" states="draft,inactive"/>
807                         <button string="Set to Inactive" name="set_inactive" type="object" states="active" />
808                         <button string="Set to Deprecated" name="set_deprecate" type="object" states="active,inactive" />
809                     </group>
810                 </form>
811             </field>
812         </record>
813
814         <record model="ir.ui.view" id="view_pos_config_tree">
815             <field name="name">pos.config.tree.view</field>
816             <field name="model">pos.config</field>
817             <field name="type">tree</field>
818             <field name="arch" type="xml">
819                 <tree string="PoS Configuration">
820                     <field name="name" />
821                     <field name="state" />
822                 </tree>
823             </field>
824         </record>
825
826         <act_window 
827             id="act_pos_config_sessions" 
828             name="Sessions"
829             src_model="pos.config"
830             res_model="pos.session"
831             domain="[('config_id', '=', active_id)]" />         
832
833         <record model="ir.actions.act_window" id="action_pos_config_pos">
834             <field name="name">Point of Sales</field>
835             <field name="type">ir.actions.act_window</field>
836             <field name="res_model">pos.config</field>
837             <field name="view_type">form</field>
838             <field name="view_mode">tree,form</field>
839         </record>
840
841         <menuitem
842             parent="menu_point_config_product"
843             action="action_pos_config_pos"
844             id="menu_pos_config_pos"
845             groups="group_pos_manager"/>
846
847
848         <record model="ir.ui.view" id="view_pos_session_form">
849             <field name="name">pos.session.form.view</field>
850             <field name="model">pos.session</field>
851             <field name="type">form</field>
852             <field name="arch" type="xml">
853                 <form string="PoS Session">
854                     <group colspan="4" col="6">
855                         <field name="config_id" />
856                         <field name="name" />
857                         <field name="user_id" />
858                         <field name="start_at" />
859                         <field name="stop_at" />
860                     </group>
861                     <notebook colspan="4">
862                         <page string="Cash">
863                             <field name="cash_register_id" invisible="0" />
864                             <field name="details_ids" colspan="4" nolabel="1">
865                                 <tree string="" editable="bottom">
866                                     <field name="pieces" readonly="1" />
867                                     <field name="number_opening" string="Opening Unit Numbers" on_change="on_change_sub_opening(pieces, number_opening, parent.balance_end)" />
868                                     <field name="subtotal_opening" string="Opening Subtotal"/>
869                                     <field name="number_closing" string="Closing Unit Numbers" on_change="on_change_sub_closing(pieces, number_closing, parent.balance_end)" />
870                                     <field name="subtotal_closing" string="Closing Subtotal"/>
871                                 </tree>
872                             </field>
873                         </page>
874 <!--                        
875                         <page string="Others">
876                         </page>
877                         <page string="Nothing">
878                         </page>
879 -->                        
880                     </notebook>
881
882                     <group colspan="4" col="5">
883                         <field name="state" widget="statusbar" statusbar_visible="new,opened,closed,posted" statusbar_colors='{"posted":"green"}'/>
884                         <button name="open" type="workflow" string="Open" states="new" />
885                         <button name="close" type="workflow" string="Close" states="opened" />
886                         <button name="post" type="workflow" string="Post" states="closed" />
887                     </group>
888                 </form>
889             </field>
890         </record>
891
892         <record model="ir.ui.view" id="view_pos_session_tree">
893             <field name="name">pos.session.tree.view</field>
894             <field name="model">pos.session</field>
895             <field name="type">tree</field>
896             <field name="arch" type="xml">
897                 <tree string="PoS Session">
898                     <field name="config_id" />
899                     <field name="name" />
900                     <field name="user_id" />
901                     <field name="start_at" />
902                     <field name="stop_at" />
903                 </tree>
904             </field>
905         </record>
906
907         <record model="ir.ui.view" id="view_pos_session_search">
908             <field name="name">pos.session.search.view</field>
909             <field name="model">pos.session</field>
910             <field name="type">search</field>
911             <field name="arch" type="xml">
912                 <search string="PoS Session">
913                     <filter string="Open" domain="[('state', '=', 'opened')]" />
914                     <separator orientation="vertical"/>
915                     <filter string="Today" domain="[('start_at', '>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" />
916                     <separator orientation="vertical"/>
917                     <field name="config_id" />
918                     <field name="name" />
919                     <field name="user_id" />
920
921                     <newline />
922                     <group expand="0" string="Group By...">
923                         <filter string="User" icon="terp-personal" domain="[]" context="{'group_by' : 'user_id'}" />
924                         <filter string="PoS" domain="[]" context="{'group_by': 'user_id'}" />
925                     </group>
926                 </search>
927             </field>
928         </record>
929
930
931         <record model="ir.actions.act_window" id="action_pos_session">
932             <field name="name">Point of Sales Session</field>
933             <field name="type">ir.actions.act_window</field>
934             <field name="res_model">pos.session</field>
935             <field name="view_type">form</field>
936             <field name="view_mode">tree,form</field>
937             <field name="search_view_id" ref="view_pos_session_search" />
938         </record>
939
940         <menuitem
941             parent="menu_point_of_sale"
942             action="action_pos_session"
943             id="menu_pos_session"
944             groups="group_pos_manager"/>
945
946         <act_window 
947             id="act_pos_session_orders" 
948             name="Orders"
949             src_model="pos.session"
950             res_model="pos.order"
951             domain="[('session_id', '=', active_id)]" />         
952
953         <record id="view_pos_order_filter" model="ir.ui.view">
954             <field name="name">pos.order.list.select</field>
955             <field name="model">pos.order</field>
956             <field name="type">search</field>
957             <field name="arch" type="xml">
958                 <search string="Search Sales Order">
959                     <filter icon="terp-document-new" string="New" domain="[('state','=','draft')]"/>
960                     <filter icon="gtk-apply" string="Done" domain="[('state','in',('paid','invoiced','done'))]"/>
961                     <separator orientation="vertical"/>
962                     <filter icon="terp-check" string="Invoiced" domain="[('state','=','invoiced')]"/>
963                     <filter icon="gtk-convert" string="Posted" domain="[('state','=','done')]"/>
964                     <separator orientation="vertical"/>
965                     <filter icon="terp-go-month" string="Today" domain="[('date_order','&gt;=',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&lt;=',datetime.date.today().strftime('%%Y-%%m-%%d 23:59:59'))]"/>
966                     <filter icon="gtk-go-forward" string="Yesterday" domain="[('date_order','&lt;',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&gt;=',(datetime.date.today() - relativedelta(days=1)).strftime('%%Y-%%m-%%d 00:00:00'))]"/>
967                     <separator orientation="vertical"/>
968                     <field name="name"/>
969                     <field name="user_id"/>
970                     <newline/>
971                     <group expand="0" string="Group By..." groups="base.group_extended">
972                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
973                         <filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
974                         <separator string="" orientation="vertical"/>
975                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
976                         <separator string="" orientation="vertical"/>
977                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
978                     </group>
979                </search>
980             </field>
981         </record>
982     </data>
983 </openerp>