sale_view.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="view_sale_orderfilter_search1" model="ir.ui.view">
  5. <field name="name">sale.order.filter.search1</field>
  6. <field name="model">sale.order</field>
  7. <field name="inherit_id" ref="sale.view_sales_order_filter" />
  8. <field name="arch" type="xml">
  9. <search>
  10. <separator/>
  11. <filter string="Este año" name="year" domain="[('date_order','&lt;=', time.strftime('%%Y-12-31')),('date_order','&gt;=',time.strftime('%%Y-01-01'))]"/>
  12. <filter string="Año pasado " domain="[('date_order','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('date_order','&lt;=', time.strftime('%%Y-01-01'))]"/>
  13. <filter string="Mes actual" domain="[('date_order','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date_order','&gt;=',time.strftime('%%Y-%%m-01'))]"/>
  14. <filter string="Mes pasado" domain="[('date_order','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('date_order','&lt;',time.strftime('%%Y-%%m-01'))]"/>
  15. <filter string="Semana anterior" domain="[('date_order', '&gt;=', ((context_today()+relativedelta(weeks=-2, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date_order', '&lt;=', ((context_today()+relativedelta(weeks=-1, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
  16. <filter string="Esta semana" domain="[('date_order', '&gt;=', ((context_today()+relativedelta(weeks=-1, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date_order', '&lt;=', ((context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
  17. <filter string="Hoy" domain="[('date_order', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('date_order', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>
  18. <filter string="Ayer" domain="[('date_order','&lt;=', (datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d')),('date_order','&gt;=',(datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
  19. <filter string="Guarani" name="currency_id" domain="[('currency_id','=','PYG')]"/>
  20. <filter string="Dolar" name="currency_id" domain="[('currency_id','=','USD')]"/>
  21. <separator/>
  22. <group string="">
  23. <filter string="Por dia" context="{'group_by':'date_order:day'}"/>
  24. <filter string="Por mes" context="{'group_by':'date_order:month'}"/>
  25. <filter string="Creado por" context="{'group_by':'create_uid'}"/>
  26. <filter string="Por sucursal" context="{'group_by':'warehouse_id'}"/>
  27. </group>
  28. </search>
  29. </field>
  30. </record>
  31. <record id="view_sale_orderline_filter_search1" model="ir.ui.view">
  32. <field name="name">sale.order.line.filter.search1</field>
  33. <field name="model">sale.order.line</field>
  34. <field name="inherit_id" ref="sale.view_sales_order_line_filter" />
  35. <field name="arch" type="xml">
  36. <search>
  37. <separator/>
  38. <filter string="Este año" name="year" domain="[('create_date','&lt;=', time.strftime('%%Y-12-31')),('create_date','&gt;=',time.strftime('%%Y-01-01'))]"/>
  39. <filter string="Año pasado " domain="[('create_date','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('create_date','&lt;=', time.strftime('%%Y-01-01'))]"/>
  40. <filter string="Mes actual" domain="[('create_date','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')), ('create_date','&gt;=',time.strftime('%%Y-%%m-01'))]"/>
  41. <filter string="Mes pasado" domain="[('create_date','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('create_date','&lt;',time.strftime('%%Y-%%m-01'))]"/>
  42. <filter string="Semana anterior" domain="[('create_date', '&gt;=', ((context_today()+relativedelta(weeks=-2, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('create_date', '&lt;=', ((context_today()+relativedelta(weeks=-1, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
  43. <filter string="Esta semana" domain="[('create_date', '&gt;=', ((context_today()+relativedelta(weeks=-1, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('create_date', '&lt;=', ((context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
  44. <filter string="Hoy" domain="[('create_date', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('create_date', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>
  45. <filter string="Ayer" domain="[('create_date','&lt;=', (datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
  46. <separator/>
  47. <group string="">
  48. <filter string="Por dia" context="{'group_by':'create_date:day'}"/>
  49. <filter string="Por mes" context="{'group_by':'create_date:month'}"/>
  50. <filter string="Creado por" context="{'group_by':'create_uid'}"/>
  51. <!-- <filter string="Por sucursal" context="{'group_by':'warehouse_id'}"/> -->
  52. </group>
  53. </search>
  54. </field>
  55. </record>
  56. </data>
  57. </openerp>