project_service_reserve.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- form view -->
  5. <record model="ir.ui.view" id="project_service_reserve_form">
  6. <field name="name">project.service.reserve.form</field>
  7. <field name="model">project.service.reserve</field>
  8. <field name="arch" type="xml">
  9. <form string="Reservas">
  10. <header>
  11. <field name="state" widget="statusbar" clickable="True"/>
  12. </header>
  13. <sheet>
  14. <group>
  15. <div class="oe_title oe_left">
  16. <div class="oe_edit_only">
  17. <label for="partner_id" string="Cliente"/>
  18. </div>
  19. <h2>
  20. <field name="partner_id" placeholder="Cliente"/>
  21. </h2>
  22. </div>
  23. </group>
  24. <group>
  25. <group>
  26. <field name="user_id" string="Funcionario" required="1"/>
  27. <field name="date" string="Fecha"/>
  28. <field name="date_reserve" string="Fecha Reservada"/>
  29. </group>
  30. <group>
  31. <field name="place" string="Lugar"/>
  32. </group>
  33. </group>
  34. </sheet>
  35. </form>
  36. </field>
  37. </record>
  38. <!-- tree view -->
  39. <record model="ir.ui.view" id="project_service_reserve_tree" >
  40. <field name="name">project.service.reserve.tree</field>
  41. <field name="model">project.service.reserve</field>
  42. <field name="arch" type="xml">
  43. <tree string="tareas">
  44. <field name="partner_id" string="Cliente"/>
  45. <field name="date_reserve" string="Fecha Reservada"/>
  46. <field name="user_id" string="Funcionario"/>
  47. <field name="place" string="Lugar"/>
  48. <field name="state" string="Estado"/>
  49. </tree>
  50. </field>
  51. </record>
  52. <!-- calendar view -->
  53. <record model="ir.ui.view" id="project_service_reserve_calendar">
  54. <field name="name">project.service.reserve.calendar</field>
  55. <field name="model">project.service.reserve</field>
  56. <field eval="2" name="priority"/>
  57. <field name="arch" type="xml">
  58. <calendar color="user_id" date_start="date_reserve" string="Reserva">
  59. <field name="place"/>
  60. <field name="name"/>
  61. </calendar>
  62. </field>
  63. </record>
  64. <!-- Search -->
  65. <record model="ir.ui.view" id="project_service_reserve_search">
  66. <field name="name">project.service.reserve.search</field>
  67. <field name="model">project.service.reserve</field>
  68. <field name="arch" type="xml">
  69. <search string="Reservas">
  70. <field name="user_id" string="Responsable"/>
  71. <field name="place" string="Lugar"/>
  72. <filter string="Mis Reservas" domain="[('user_id','=',uid)]"/>
  73. <separator/>
  74. <filter string="Terminados" name="End" domain="[('state','=','done')]"/>
  75. <filter string="Pendientes" name="Pending" domain="[('state','=','confirmed')]"/>
  76. <filter string="Hoy" domain="[('date_reserve', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('date_reserve', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>
  77. <filter string="Ayer" domain="[('date_reserve','&lt;=', (datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d')),('date_reserve','&gt;=',(datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
  78. <filter string="Esta semana" domain="[('date_reserve', '&gt;=', ((context_today()+relativedelta(weeks=-1, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date_reserve', '&lt;=', ((context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
  79. <filter string="Mes actual" domain="[('date_reserve','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date_reserve','&gt;=',time.strftime('%%Y-%%m-01'))]"/>
  80. <filter string="Mes pasado" domain="[('date_reserve','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('date_reserve','&lt;',time.strftime('%%Y-%%m-01'))]"/>
  81. <separator/>
  82. <group expand="0" string="Agrupar por ">
  83. <filter string="Responsables" name="User" context="{'group_by':'user_id'}"/>
  84. <filter string="Cliente" name="Customer" context="{'group_by':'partner_id'}"/>
  85. <separator/>
  86. </group>
  87. </search>
  88. </field>
  89. </record>
  90. <!-- action -->
  91. <record model="ir.actions.act_window" id="project_service_reserve_action">
  92. <field name="name">Todas las Reservas</field>
  93. <field name="res_model">project.service.reserve</field>
  94. <field name="view_type">form</field>
  95. <field name="view_mode">calendar,tree,form</field>
  96. <field name="search_view_id" ref="project_service_reserve_search"/>
  97. <field name="context">{'search_default_Pending': 1}</field>
  98. </record>
  99. <!-- menus -->
  100. <menuitem name="Reservas" parent="project_service_parent_menu" id="project_service_reserve_all_menu" sequence="3" action="project_service_reserve_action"/>
  101. </data>
  102. </openerp>