project_service_task.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- actions -->
  5. <act_window
  6. id="action_open_account_invoice"
  7. name="Factura"
  8. res_model="account.invoice"
  9. view_type="form"
  10. view_mode="tree,form"
  11. domain="[('task_invoice_id', '=', active_id)]"/>
  12. <act_window
  13. id="action_open_single_account_invoice"
  14. name="Factura"
  15. res_model="account.invoice"
  16. view_type="form"
  17. view_mode="tree,form"
  18. target="current"
  19. domain="[('invoice_ids', 'in', active_id)]"/>
  20. <!-- Form View -->
  21. <record model="ir.ui.view" id="project_service_task_form">
  22. <field name="name">project.service.task.form</field>
  23. <field name="model">project.service.task</field>
  24. <field name="arch" type="xml">
  25. <form string="Worksheet">
  26. <header>
  27. <button name="Facturado" string="Crear Factura" type="object" class="btn-primary" states="Preparado"/>
  28. <button class="btn-primary" name="cancel" string="Cancelar" type="object" states="Preparado"/>
  29. <button name="button_draft"
  30. states="Cancelado,Facturado"
  31. string="Cambiar Estado"
  32. type="object"/>
  33. <field name="stage_id" widget="statusbar" clickable="True"/>
  34. <field name="state" widget="statusbar" invisible="1"/>
  35. </header>
  36. <sheet string="Hoja de Tarea">
  37. <div class="oe_title">
  38. <h1 class="o_row">
  39. <field name="partner_id" placeholder="Cliente" required="1" attrs="{'readonly': [('state','!=', 'Preparado')]}"/>
  40. </h1>
  41. </div>
  42. <div class="oe_right oe_button_box">
  43. <button
  44. class="oe_inline oe_stat_button"
  45. type="action"
  46. name="%(action_open_account_invoice)d"
  47. icon="fa-money">
  48. <field name="invoice_count" string="Facturas" widget="statinfo" />
  49. </button>
  50. </div>
  51. <group>
  52. <group>
  53. <field name="reserve_id" string="Reserva" attrs="{'readonly': [('state','!=', 'Preparado')]}" domain="[('state','=','confirmed')]"/>
  54. <field name="project_id" string="Lugar" attrs="{'readonly': [('state','!=', 'Preparado')]}" domain="[('active','=',1)]"/>
  55. </group>
  56. <group>
  57. <field name="date" string="Fecha y Hora" attrs="{'readonly': [('state','!=', 'Preparado')]}"/>
  58. </group>
  59. </group>
  60. <notebook>
  61. <page name="timesheet_page" string="Hoja de trabajo">
  62. <group string ="Trabajo Planeado">
  63. <field name="activity_ids" nolabel="1" attrs="{'readonly': [('state','!=', 'Preparado')]}">
  64. <tree string="Planned Work" editable="bottom">
  65. <field name="product_id" string="Trabajo" required="1"/>
  66. <field name="work_date" string="Fecha de trabajo"/>
  67. <field name="user_id" string="Responsable"/>
  68. <field name="work_cost" string="Precio" sum="total" required="1"/>
  69. <field name="completed" string="¿El trabajo esta terminado?"/>
  70. </tree>
  71. </field>
  72. </group>
  73. <group string = "Materiales Utilizados">
  74. <field name="materials_used" nolabel="1" attrs="{'readonly': [('state','!=', 'Preparado')]}"/>
  75. </group>
  76. <group>
  77. <field name="include_materials" class="oe_inline" string="¿Incluir materiales en la factura?" attrs="{'readonly': [('state','!=', 'Preparado')]}"/>
  78. </group>
  79. <group>
  80. <label for="amount_total" string="Monto Total"/>
  81. <h1>
  82. <field name="amount_total"/>
  83. </h1>
  84. </group>
  85. </page>
  86. </notebook>
  87. </sheet>
  88. </form>
  89. </field>
  90. </record>
  91. <!-- Tree view -->
  92. <record model="ir.ui.view" id="project_service_task_tree">
  93. <field name="name">project.service.task.tree</field>
  94. <field name="model">project.service.task</field>
  95. <field name="arch" type="xml">
  96. <tree string="Tareas">
  97. <field name="name" string="Titulo"/>
  98. <field name="project_id" string="Proyecto"/>
  99. <field name="date" string="Fecha limite"/>
  100. <field name="stage_id" string="Etapa"/>
  101. </tree>
  102. </field>
  103. </record>
  104. <!-- Kanban view -->
  105. <record model="ir.ui.view" id="project_service_task_kanban">
  106. <field name="name">project.service.task.kanban</field>
  107. <field name="model">project.service.task</field>
  108. <field name="arch" type="xml">
  109. <kanban default_group_by="stage_id">
  110. <field name="color"/>
  111. <field name="priority"/>
  112. <field name="date"/>
  113. <templates>
  114. <t t-name="kanban-box">
  115. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
  116. <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
  117. <span class="oe_e">í</span>
  118. <ul class="oe_dropdown_menu">
  119. <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
  120. <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
  121. <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
  122. </ul>
  123. </div>
  124. <div class="oe_kanban_content">
  125. <div><b><field name="name"/></b></div>
  126. <div>
  127. <t t-if="record.date.raw_value and record.date.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
  128. <span t-attf-class="#{red || ''}"><i><field name="date"/></i></span>
  129. </div>
  130. </div>
  131. <div class="oe_clear"></div>
  132. </div>
  133. </t>
  134. </templates>
  135. </kanban>
  136. </field>
  137. </record>
  138. <!-- calendar view -->
  139. <record model="ir.ui.view" id="project_service_task_calendar">
  140. <field name="name">project.service.task.calendar</field>
  141. <field name="model">project.service.task</field>
  142. <field eval="2" name="priority"/>
  143. <field name="arch" type="xml">
  144. <calendar color="partner_id" date_start="date" string="Tasks">
  145. <field name="name"/>
  146. <field name="project_id"/>
  147. </calendar>
  148. </field>
  149. </record>
  150. <!-- search view -->
  151. <record model="ir.ui.view" id="project_service_task_search">
  152. <field name="name">project.service.task.search</field>
  153. <field name="model">project.service.task</field>
  154. <field name="arch" type="xml">
  155. <search string="Tareas">
  156. <field name="name" string="Tarea"/>
  157. <field name="partner_id" string="Cliente"/>
  158. <field name="project_id" string="Proyecto"/>
  159. <field name="stage_id" string="Etapa"/>
  160. <separator/>
  161. <filter string="Nuevo" name="draft" domain="[('stage_id.sequence', '&lt;=', 1)]"/>
  162. <separator/>
  163. <group expand="0" string="Agrupar por ">
  164. <filter string="Proyecto" name="project" context="{'group_by':'project_id'}"/>
  165. <filter string="Etapa" name="Stage" context="{'group_by':'stage_id'}"/>
  166. <filter string="Estado" name="State" context="{'group_by':'state'}"/>
  167. <separator/>
  168. </group>
  169. </search>
  170. </field>
  171. </record>
  172. <!-- action -->
  173. <record model="ir.actions.act_window" id="project_service_task_action">
  174. <field name="name">Clientes </field>
  175. <field name="res_model">project.service.task</field>
  176. <field name="view_type">form</field>
  177. <field name="view_mode">kanban,tree,form,calendar</field>
  178. </record>
  179. <!-- menus -->
  180. <menuitem name="Clientes" id="project_service_task_all_menu" parent="project_service_parent_menu" action="project_service_task_action" sequence="2"/>
  181. </data>
  182. </openerp>