project_task_views.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="project_project_view_inherit_project_filter" model="ir.ui.view">
  4. <field name="name">project.project.select.inherit.project</field>
  5. <field name="model">project.project</field>
  6. <field name="inherit_id" ref="project.view_project_project_filter"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//field[@name='partner_id']" position="after">
  9. <field name="sale_order_id"/>
  10. </xpath>
  11. </field>
  12. </record>
  13. <record id="project_project_view_tree_inherit_sale_project" model="ir.ui.view">
  14. <field name="name">project.project.tree.inherit.sale.project</field>
  15. <field name="model">project.project</field>
  16. <field name="inherit_id" ref="project.view_project"/>
  17. <field name="priority">50</field>
  18. <field name="arch" type="xml">
  19. <xpath expr="//field[@name='partner_id']" position="after">
  20. <field name="sale_line_id" optional="hide" readonly="1"/>
  21. </xpath>
  22. </field>
  23. </record>
  24. <record id="view_edit_project_inherit_form" model="ir.ui.view">
  25. <field name="name">project.project.view.inherit</field>
  26. <field name="model">project.project</field>
  27. <field name="inherit_id" ref="project.edit_project"/>
  28. <field name="arch" type="xml">
  29. <xpath expr="//header" position="inside">
  30. <field name="has_any_so_to_invoice" invisible="1"/>
  31. <field name="has_any_so_with_nothing_to_invoice" invisible="1"/>
  32. <!-- remove me in master -->
  33. <button name="action_create_invoice" string="Create Invoice" type="object" class="btn-primary" groups="sales_team.group_sale_salesman_all_leads" attrs="{'invisible': [('has_any_so_to_invoice', '=', False)]}" data-hotkey="w" invisible="1"/>
  34. <!-- remove me in master -->
  35. <button name="action_create_invoice" string="Create Invoice" type="object" class="btn-secondary" groups="sales_team.group_sale_salesman_all_leads" attrs="{'invisible': ['|', ('has_any_so_with_nothing_to_invoice', '=', False), ('has_any_so_to_invoice', '=', True)]}" data-hotkey="w" invisible="1"/>
  36. </xpath>
  37. <xpath expr="//field[@name='partner_id']" position="attributes">
  38. <attribute name="options">{'always_reload': True}</attribute>
  39. <attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
  40. </xpath>
  41. <xpath expr="//group[@name='group_time_managment']" position="after">
  42. <group name="group_sales_invoicing" string="Sales &amp; Invoicing" col="1" class="row mt16 o_settings_container col-lg-6">
  43. <div>
  44. <div class="o_setting_box" id="allow_billable_container">
  45. <div class="o_setting_left_pane">
  46. <field name="allow_billable"/>
  47. </div>
  48. <div class="o_setting_right_pane">
  49. <label for="allow_billable"/>
  50. <div class="text-muted" id="allow_billable_setting">
  51. Invoice your time and material to customers
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </group>
  57. </xpath>
  58. </field>
  59. </record>
  60. <record id="view_sale_project_inherit_form" model="ir.ui.view">
  61. <field name="name">project.task.view.inherit</field>
  62. <field name="model">project.task</field>
  63. <field name="inherit_id" ref="project.view_task_form2"/>
  64. <field name="arch" type="xml">
  65. <xpath expr="//span[@id='start_rating_buttons']" position="before">
  66. <button class="oe_stat_button"
  67. type="object" name="action_view_so" icon="fa-dollar"
  68. attrs="{'invisible': [('sale_order_id', '=', False)]}"
  69. string="Sales Order"
  70. groups="sales_team.group_sale_salesman_all_leads"/>
  71. </xpath>
  72. <xpath expr="//field[@name='partner_id']" position="attributes">
  73. <attribute name="options">{'always_reload': True}</attribute>
  74. <attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
  75. </xpath>
  76. <xpath expr="//field[@name='partner_phone']" position="after">
  77. <field name="sale_order_id" attrs="{'invisible': True}" groups="sales_team.group_sale_salesman"/>
  78. <field name="sale_line_id" groups="!sales_team.group_sale_salesman" string="Sales Order Item" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
  79. <field name="sale_line_id" groups="sales_team.group_sale_salesman" string="Sales Order Item" options='{"no_create": True}' readonly="0" context="{'create': False, 'edit': False, 'delete': False, 'with_price_unit': True}"/>
  80. <field name="commercial_partner_id" invisible="1" />
  81. </xpath>
  82. </field>
  83. </record>
  84. <record id="project_task_view_search" model="ir.ui.view">
  85. <field name="name">project.task.search.inherit</field>
  86. <field name="model">project.task</field>
  87. <field name="inherit_id" ref="project.view_task_search_form"/>
  88. <field name="arch" type="xml">
  89. <xpath expr="//field[@name='partner_id']" position="after">
  90. <field name="sale_order_id" string="Sale Order" filter_domain="['|', ('sale_order_id', 'ilike', self), ('sale_line_id', 'ilike', self)]"/>
  91. </xpath>
  92. <xpath expr="//search/group/filter[@name='customer']" position="after">
  93. <filter string="Sales Order Item" name="sale_line_id" context="{'group_by': 'sale_line_id'}"/>
  94. </xpath>
  95. </field>
  96. </record>
  97. <record id="project_milestone_view_form" model="ir.ui.view">
  98. <field name="name">project.milestone.view.form.inherit</field>
  99. <field name="model">project.milestone</field>
  100. <field name="inherit_id" ref="project.project_milestone_view_form"/>
  101. <field name="arch" type="xml">
  102. <xpath expr="//group[@name='main_details']" position="after">
  103. <field name="allow_billable" invisible="1"/>
  104. <group attrs="{'invisible': [('allow_billable', '=', False)]}">
  105. <field name="project_partner_id" invisible="1"/>
  106. <field name="sale_line_id" groups="!sales_team.group_sale_salesman" placeholder="Non-billable" options="{'no_open': True}" readonly="1"/>
  107. <field name="sale_line_id" groups="sales_team.group_sale_salesman" options="{'no_create': True}" placeholder="Non-billable" readonly="0"/>
  108. <field name="quantity_percentage" groups="!sales_team.group_sale_salesman" widget="percentage" readonly="1"/>
  109. <field name="quantity_percentage" class="w-25" groups="sales_team.group_sale_salesman" widget="percentage" readonly="0"/>
  110. </group>
  111. </xpath>
  112. </field>
  113. </record>
  114. <record id="project_milestone_view_tree" model="ir.ui.view">
  115. <field name="name">project.milestone.view.tree.inherit</field>
  116. <field name="model">project.milestone</field>
  117. <field name="inherit_id" ref="project.project_milestone_view_tree"/>
  118. <field name="mode">primary</field>
  119. <field name="arch" type="xml">
  120. <xpath expr="//field[@name='name']" position="after">
  121. <field name="project_partner_id" invisible="1"/>
  122. <field name="allow_billable" invisible="1"/>
  123. <field name="sale_line_id" optional="hide" options="{'no_open': True}" placeholder="Non-billable" readonly="1" groups="!sales_team.group_sale_salesman"/>
  124. <field name="sale_line_id" optional="hide" options="{'no_create': True}" placeholder="Non-billable" groups="sales_team.group_sale_salesman"/>
  125. <field name="quantity_percentage" optional="hide" widget="percentage" readonly="1" groups="!sales_team.group_sale_salesman"/>
  126. <field name="quantity_percentage" optional="hide" widget="percentage" groups="sales_team.group_sale_salesman"/>
  127. </xpath>
  128. </field>
  129. </record>
  130. <record id="sale_project_milestone_view_tree" model="ir.ui.view">
  131. <field name="name">project.milestone.view.tree.inherit</field>
  132. <field name="model">project.milestone</field>
  133. <field name="inherit_id" ref="sale_project.project_milestone_view_tree"/>
  134. <field name="mode">primary</field>
  135. <field name="arch" type="xml">
  136. <xpath expr="//field[@name='sale_line_id'][1]" position="attributes">
  137. <attribute name="optional">show</attribute>
  138. </xpath>
  139. <xpath expr="//field[@name='sale_line_id'][2]" position="attributes">
  140. <attribute name="optional">show</attribute>
  141. </xpath>
  142. <xpath expr="//field[@name='quantity_percentage'][1]" position="attributes">
  143. <attribute name="optional">show</attribute>
  144. </xpath>
  145. <xpath expr="//field[@name='quantity_percentage'][2]" position="attributes">
  146. <attribute name="optional">show</attribute>
  147. </xpath>
  148. </field>
  149. </record>
  150. </odoo>