work_order.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <!-- ations -->
  5. <act_window
  6. id="action_open_account_invoice"
  7. name="Trabajos"
  8. res_model="account.invoice"
  9. view_type="form"
  10. view_mode="tree,form"
  11. domain="[('work_invoice_id', '=', active_id)]"/>
  12. <act_window
  13. id="action_open_single_account_invoice"
  14. name="Trabajos"
  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. <!-- tree view -->
  21. <record id="tree_repair_workorder" model="ir.ui.view">
  22. <field name="name">repair.workorder.tree</field>
  23. <field name="model">repair.workorder</field>
  24. <field name="arch" type="xml">
  25. <tree string="Work Order" default_order="planned_start_date desc">
  26. <field name="name"/>
  27. <field name="user_id"/>
  28. <field name="partner_id"/>
  29. <field name="planned_start_date"/>
  30. <field name="planned_end_date"/>
  31. <field name="state"/>
  32. </tree>
  33. </field>
  34. </record>
  35. <!-- search view -->
  36. <record id="search_repair_workorder" model="ir.ui.view">
  37. <field name="name">repair.workorder.search</field>
  38. <field name="model">repair.workorder</field>
  39. <field name="arch" type="xml">
  40. <search string="Work Order">
  41. <field name="name"/>
  42. <field name="user_id"/>
  43. <field name="partner_id"/>
  44. <filter string="Mis tareas" domain="[('user_id','=',uid)]"/>
  45. <filter string="Realizada" domain="[('state','=','done')]"/>
  46. <separator/>
  47. <group expand="0" string="Group By...">
  48. <filter string="User" domain="[]" context="{'group_by':'user_id'}" />
  49. <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}" />
  50. <filter string="Estado" name="State" context="{'group_by':'state'}"/>
  51. </group>
  52. </search>
  53. </field>
  54. </record>
  55. <!-- form view -->
  56. <record id="form_repair_workorder" model="ir.ui.view">
  57. <field name="name">repair.workorder.form</field>
  58. <field name="model">repair.workorder</field>
  59. <field name="arch" type="xml">
  60. <form string="Work Order">
  61. <header>
  62. <!-- <button name="button_attachment" string="Attachment" type="object" icon="gtk-go-forward" colspan='1' /> -->
  63. <button name="Facturado" string="Crear Factura" type="object" class="btn-primary" states="done"/>
  64. <button name="button_draft" states="invoiced" string="Cambiar Estado" type="object"/>
  65. <button name="button_in_progress" type="object" states="draft,warranty" string="Begin work" class="oe_highlight" groups="base.group_user"/>
  66. <button name="button_in_progress_back" type="object" states="in_progress" string="Back" class="oe_highlight" groups="base.group_user"/>
  67. <button name="button_done" type="object" states="in_progress" string="Done" class="oe_highlight" groups="base.group_user"/>
  68. <button name="button_done_back" type="object" states="done" string="Back" class="oe_highlight" groups="base.group_user"/>
  69. <button name="button_cancel" type="object" states="draft,warranty,in_progress" string="Cancel" class="oe_highlight" groups="base.group_user"/>
  70. <field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done" statusbar_colors='{"done":"red","warning":"blue","canceled":"red","in_progress":"blue"}'/>
  71. </header>
  72. <sheet>
  73. <div class="oe_title">
  74. <h1>
  75. <label string="Workorder "/>
  76. <field name="name" class="oe_inline" readonly="1"/>
  77. </h1>
  78. </div>
  79. <div class="oe_right oe_button_box">
  80. <button
  81. class="oe_inline oe_stat_button"
  82. type="action"
  83. name="%(action_open_account_invoice)d"
  84. icon="fa-money">
  85. <field name="invoice_count" string="Facturas" widget="statinfo" />
  86. </button>
  87. </div>
  88. <group>
  89. <group>
  90. <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}' attrs="{'readonly': [('state','!=', 'draft')]}" required="1"/>
  91. <field name="user_id" attrs="{'readonly': [('state','=', 'invoiced')]}" required="1"/>
  92. <field name="filename" invisible="1"/>
  93. <field name="file_import" filename="filename"/>
  94. <field name="filename_a" invisible="1"/>
  95. <field name="file_import_a" filename="filename_a"/>
  96. <field name="filename_b" invisible="1"/>
  97. <field name="file_import_b" filename="filename_b"/>
  98. <field name="type"/>
  99. </group>
  100. <group name="Dates">
  101. <field name="order_date" attrs="{'readonly': [('state','=','invoiced')]}" required="1"/>
  102. <field name="planned_start_date" attrs="{'readonly': [('state','=','invoiced')]}" required="1"/>
  103. <field name="planned_end_date" attrs="{'readonly': [('state','=','invoiced')]}" required="1"/>
  104. <field name="next_action_date" attrs="{'readonly': [('state','=','in_progres')]}" string="Fecha Próx. Mantenimiento"/>
  105. </group>
  106. </group>
  107. <separator string="Equipo"/>
  108. <field name="line_ids" attrs="{'readonly': [('state','=','invoiced')]}"/>
  109. <separator string="Diagnostic"/>
  110. <field name="diagnostic" placeholder="describe the diagnostic..." attrs="{'readonly': [('state','=','invoiced')]}"/>
  111. <separator string="Descripción del Trabajo"/>
  112. <field name="actions" placeholder="Descripción del trabajo" attrs="{'readonly': [('state','=','invoiced')]}"/>
  113. <separator string="Recomendaciones Técnicas"/>
  114. <field name="recommendations" placeholder="describe the recommendations..." attrs="{'readonly': [('state','=','invoiced')]}"/>
  115. <separator string="Repuestos y piezas utilizadas"/>
  116. <field name="consumed_ids" attrs="{'readonly': [('state','=','invoiced')]}"/>
  117. <separator string="Observaciones Técnicas" invisible="1"/>
  118. <field name="causes" placeholder="describe las observaciones técnicas..." invisible="1" attrs="{'readonly': [('state','=','invoiced')]}"/>
  119. <!-- </page> -->
  120. <!-- <page string="Repuestos y piezas utilizadas">
  121. </page>
  122. <page string="Operations">
  123. </page> -->
  124. <!-- </notebook> -->
  125. </sheet>
  126. <div class="oe_chatter">
  127. <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
  128. <field name="message_ids" widget="mail_thread"/>
  129. </div>
  130. </form>
  131. </field>
  132. </record>
  133. <!-- calendar view -->
  134. <record id="calendar_repair_workorder" model="ir.ui.view">
  135. <field name="name">repair.workorder.calendar</field>
  136. <field name="model">repair.workorder</field>
  137. <field name="arch" type="xml">
  138. <calendar color="user_id" date_start="planned_start_date" string="Repair">
  139. <field name="name"/>
  140. </calendar>
  141. </field>
  142. </record>
  143. <!-- gantt -->
  144. <record id="gantt_repair_workorder" model="ir.ui.view">
  145. <field name="name">repair.workorder.calendar</field>
  146. <field name="model">repair.workorder</field>
  147. <field name="arch" type="xml">
  148. <gantt date_start="planned_start_date" date_stop="planned_end_date" progress="progress" string="Tasks" default_group_by="project_id">
  149. </gantt>
  150. </field>
  151. </record>
  152. <!-- action -->
  153. <record id="action_repair_workorder" model="ir.actions.act_window">
  154. <field name="name">Work Order</field>
  155. <field name="type">ir.actions.act_window</field>
  156. <field name="res_model">repair.workorder</field>
  157. <field name="view_type">form</field>
  158. <field name="view_mode">tree,form,calendar,gantt</field>
  159. <field name="search_view_id" ref="search_repair_workorder"/>
  160. </record>
  161. <!-- tree view -->
  162. <record id="tree_repair_workorder_line" model="ir.ui.view">
  163. <field name="name">repair.workorder.line.tree</field>
  164. <field name="model">repair.workorder.line</field>
  165. <field name="arch" type="xml">
  166. <tree string="Work order line" editable="bottom">
  167. <field name="description" required="1"/>
  168. <field name="brand" required="1"/>
  169. <field name="number" required="1"/>
  170. </tree>
  171. </field>
  172. </record>
  173. <!-- search view -->
  174. <record id="search_repair_workorder_line" model="ir.ui.view">
  175. <field name="name">repair.workorder.line.search</field>
  176. <field name="model">repair.workorder.line</field>
  177. <field name="arch" type="xml">
  178. <search string="Work order line">
  179. <field name="description"/>
  180. <field name="quantity"/>
  181. <newline />
  182. <group expand="0" string="Group By...">
  183. </group>
  184. </search>
  185. </field>
  186. </record>
  187. <record id="form_repair_workorder_line" model="ir.ui.view">
  188. <field name="name">repair.workorder.line.form</field>
  189. <field name="model">repair.workorder.line</field>
  190. <field name="arch" type="xml">
  191. <form string="Work order line">
  192. <sheet>
  193. <group>
  194. <field name="description" required="1"/>
  195. <field name="brand" required="1"/>
  196. <field name="number" required="1"/>
  197. </group>
  198. </sheet>
  199. </form>
  200. </field>
  201. </record>
  202. <record id="action_repair_workorder_line" model="ir.actions.act_window">
  203. <field name="name">Work order line</field>
  204. <field name="type">ir.actions.act_window</field>
  205. <field name="res_model">repair.workorder.line</field>
  206. <field name="view_type">form</field>
  207. <field name="view_mode">tree,form</field>
  208. <field name="search_view_id" ref="search_repair_workorder_line"/>
  209. </record>
  210. <record id="tree_repair_workorder_consumed" model="ir.ui.view">
  211. <field name="name">repair.workorder.consumed.tree</field>
  212. <field name="model">repair.workorder.consumed</field>
  213. <field name="arch" type="xml">
  214. <tree string="Consumed products and services" editable="bottom">
  215. <field name="product_id"/>
  216. <field name="description"/>
  217. <field name="quantity"/>
  218. <field name="price_unit"/>
  219. <field name="subtotal"/>
  220. <field name="type"/>
  221. </tree>
  222. </field>
  223. </record>
  224. <record id="search_repair_workorder_consumed" model="ir.ui.view">
  225. <field name="name">repair.workorder.consumed.search</field>
  226. <field name="model">repair.workorder.consumed</field>
  227. <field name="arch" type="xml">
  228. <search string="Consumed products and services">
  229. <field name="type"/>
  230. <field name="product_id"/>
  231. <field name="description"/>
  232. <field name="quantity"/>
  233. <field name="price_unit"/>
  234. <field name="subtotal"/>
  235. <newline />
  236. <group expand="0" string="Group By...">
  237. <filter string="Nombre" domain="[]" context="{'group_by':'type'}" />
  238. </group>
  239. </search>
  240. </field>
  241. </record>
  242. <record id="form_repair_workorder_consumed" model="ir.ui.view">
  243. <field name="name">repair.workorder.consumed.form</field>
  244. <field name="model">repair.workorder.consumed</field>
  245. <field name="arch" type="xml">
  246. <form string="Consumed products and services">
  247. <sheet>
  248. <group>
  249. <field name="product_id"/>
  250. <field name="type"/>
  251. <field name="description"/>
  252. <field name="quantity"/>
  253. <field name="price_unit"/>
  254. <field name="subtotal"/>
  255. </group>
  256. </sheet>
  257. </form>
  258. </field>
  259. </record>
  260. <record id="action_repair_workorder_consumed" model="ir.actions.act_window">
  261. <field name="name">Consumed products and services</field>
  262. <field name="type">ir.actions.act_window</field>
  263. <field name="res_model">repair.workorder.consumed</field>
  264. <field name="view_type">form</field>
  265. <field name="view_mode">tree,form</field>
  266. <field name="search_view_id" ref="search_repair_workorder_consumed"/>
  267. </record>
  268. <menuitem id="repair_workorder" parent="base.menu_sales" action="action_repair_workorder" name="Work order" sequence="20"/>
  269. </data>
  270. </openerp>