project_service_activity.xml 6.0 KB

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