crm_task_view.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record model="ir.ui.view" id="crm_task_form">
  5. <field name="name">crm_task_form</field>
  6. <field name="model">crm.task</field>
  7. <field name="type">form</field>
  8. <field name="new">new</field>
  9. <field name="arch" type="xml">
  10. <form>
  11. <header class="oe_edit_only">
  12. <button name="createOpportunity" string="Convertir a Oportunidad" type="object" attrs="{'invisible':['|',('is_opportunity','!=', False),('opportunity_id','!=', False)]}"/>
  13. <field name="state" clickable="True" widget="statusbar"/>
  14. </header>
  15. <sheet>
  16. <group>
  17. <field name="task_type_id" widget="radio" required='True'/>
  18. </group>
  19. <group>
  20. <field name="name" required='True'/>
  21. <field name="date_action_next"/>
  22. <field name="date_last_state_update" invisible="1"/>
  23. <field name="opportunity_id"
  24. options='{"no_create": 1, "no_create_edit": 1}'/>
  25. <field name="partner_id" required='True'/>
  26. <field name="user_id" options='{"no_create": 1, "no_create_edit": 1}' required='True'/>
  27. <field name="description"/>
  28. <field name="is_opportunity" invisible='1'/>
  29. </group>
  30. </sheet>
  31. </form>
  32. </field>
  33. </record>
  34. <record id="task_filter" model="ir.ui.view">
  35. <field name="name">CRM - Opportunities Search</field>
  36. <field name="model">crm.task</field>
  37. <field name="arch" type="xml">
  38. <search string="Search Opportunities">
  39. <field name="partner_id" string="Cliente" filter_domain="[('partner_id','ilike',self)]"/>
  40. <field name="opportunity_id" string="Oportunidad"/>
  41. <field name="state" string="Estado"/>
  42. <field name="user_id" string="Responsable"/>
  43. <field string="Tipo de Tarea" name="task_type_id"/>
  44. </search>
  45. </field>
  46. </record>
  47. <record id="crm_task_calendar" model="ir.ui.view">
  48. <field name="name">Calendario de Tareas</field>
  49. <field name="model">crm.task</field>
  50. <field name="type">calendar</field>
  51. <field name="arch" type="xml">
  52. <calendar color="task_type_id" quick_add="false" date_start="date_action_next" date_stop="" string="Tareas" event_open_popup="%(crm_task_form)d">
  53. <field name="name"/>
  54. </calendar>
  55. </field>
  56. </record>
  57. <record model="ir.ui.view" id="crm_task_tree">
  58. <field name="name">crm_task_tree</field>
  59. <field name="model">crm.task</field>
  60. <field name="type">tree</field>
  61. <field name="arch" type="xml">
  62. <tree string="Oportunidades" clickable="True" colors="red:expired_date == True and state == 'pending';gray:state == 'cancel';green:state == 'pending'">
  63. <field name="task_type_id" options='{"no_open": True, "no_create": 1, "no_create_edit": 1}'/>
  64. <field name="create_date" string="Fecha de Creación"/>
  65. <field name="date_last_state_update" invisible="1"/>
  66. <field name="date_action_next"/>
  67. <field name="name"/>
  68. <field name="description"/>
  69. <field name="user_id"/>
  70. <field name="partner_id"/>
  71. <field name="state"/>
  72. <field name="expired_date" invisible="1"/>
  73. <button name="action_done" string="Realizado" type="object" icon="gtk-apply" attrs="{'invisible':[('state','=','done')]}"/>
  74. <button name="action_done" string="Pendiente" type="object" icon="gtk-undo" attrs="{'invisible':[('state','=','pending')]}"/>
  75. <button name="action_cancel" string="Cancelado" type="object" icon="gtk-cancel" attrs="{'invisible':[('state','=','cancel')]}"/>
  76. </tree>
  77. </field>
  78. </record>
  79. <record id="crm_task_from_partner" model="ir.actions.act_window">
  80. <field name="name">Tareas</field>
  81. <field name="res_model">crm.task</field>
  82. <field name="view_type">form</field>
  83. <field name="view_mode">calendar,tree,form</field>
  84. <field name="context">{"search_default_state":'pending', 'search_default_user_id': uid}</field>
  85. <field name="search_view_id" ref="task_filter"/>
  86. <field name="help" type="html">
  87. <p class="oe_view_nocontent_create">
  88. Click to create a new task.
  89. </p>
  90. </field>
  91. </record>
  92. <record model="ir.actions.act_window.view" id="action_crm_task_calendar">
  93. <field name="sequence" eval="1"/>
  94. <field name="view_mode">calendar</field>
  95. <field name="view_id" ref="crm_task_calendar"/>
  96. <field name="act_window_id" ref="crm_task_from_partner"/>
  97. </record>
  98. <record model="ir.actions.act_window.view" id="action_crm_tree_task">
  99. <field name="sequence" eval="2"/>
  100. <field name="view_mode">tree</field>
  101. <field name="view_id" ref="crm_task_tree"/>
  102. <field name="act_window_id" ref="crm_task_from_partner"/>
  103. </record>
  104. <!-- Tree Wizard view from kanban -->
  105. <record id="tree_wizard_filter" model="ir.ui.view">
  106. <field name="name">tree_wizard_filter</field>
  107. <field name="model">crm.task</field>
  108. <field name="arch" type="xml">
  109. <search string="Search Task">
  110. </search>
  111. </field>
  112. </record>
  113. <record id="action_tree_wizard" model="ir.actions.act_window">
  114. <field name="name">Tareas</field>
  115. <field name="res_model">crm.task</field>
  116. <field name="view_type">form</field>
  117. <field name="view_mode">tree</field>
  118. <field name="target">new</field>
  119. <field name="search_view_id" ref="tree_wizard_filter"/>
  120. <field name="domain">[('opportunity_id', '=', active_id),('state','=','pending')]</field>
  121. </record>
  122. <!-- Form Wizard view with custom buttons -->
  123. <record model="ir.ui.view" id="crm_task_wizard">
  124. <field name="name">crm_task_wizard</field>
  125. <field name="model">crm.task</field>
  126. <field name="type">form</field>
  127. <field name="target">new</field>
  128. <field name="arch" type="xml">
  129. <form>
  130. <header class="oe_edit_only" >
  131. <button name="createOpportunity" string="Convertir a Oportunidad" type="object" attrs="{'invisible':['|',('is_opportunity','!=', False),('opportunity_id','!=', False)]}"/>
  132. <field name="state" clickable="True" widget="statusbar"/>
  133. </header>
  134. <sheet>
  135. <group>
  136. <field name="task_type_id" widget="radio" required='True'/>
  137. </group>
  138. <group>
  139. <field name="name" required='True'/>
  140. <field name="date_action_next"/>
  141. <field name="date_last_state_update" invisible="1"/>
  142. <field name="opportunity_id"
  143. options='{"no_create": 1, "no_create_edit": 1}'/>
  144. <field name="partner_id" required='True'/>
  145. <field name="user_id" required='True' options='{"no_create": 1, "no_create_edit": 1}'/>
  146. <field name="description"/>
  147. <field name="is_opportunity" invisible='1'/>
  148. </group>
  149. </sheet>
  150. <footer>
  151. <button name="write" string="Crear" type="object" class="oe_highlight"/> o
  152. <button string="Cancelar" class="oe_link" special="cancel"/>
  153. </footer>
  154. </form>
  155. </field>
  156. </record>
  157. </data>
  158. </openerp>