You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.9 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Copyright 2018 ACSONE SA/NV.
  4. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. -->
  6. <odoo>
  7. <record id="view_order_form" model="ir.ui.view">
  8. <field name="name">sale.order.form (in product_contract)</field>
  9. <field name="model">sale.order</field>
  10. <field name="inherit_id" ref="sale.view_order_form"/>
  11. <field name="arch" type="xml">
  12. <xpath expr="//div[@name='button_box']" position="inside">
  13. <button name="action_show_contracts"
  14. type="object" icon="fa-book"
  15. class="oe_stat_button"
  16. attrs="{'invisible': ['|', ('is_contract', '!=', True), ('state', 'not in', ['sale', 'done'])]}">
  17. <field string="Contracts"
  18. name="contract_count"
  19. widget="statinfo"/>
  20. </button>
  21. </xpath>
  22. <xpath expr="//field[@name='order_line']" position="before">
  23. <field name="is_contract" invisible="1"/>
  24. </xpath>
  25. <xpath expr="//field[@name='order_line']/form//field[@name='product_id']"
  26. position="after">
  27. <field name="contract_template_id" invisible="1"/>
  28. <field name="contract_id"
  29. attrs="{'invisible': [('is_contract', '=', False)]}"
  30. domain="[('partner_id','=',parent.partner_id),('contract_template_id','=',contract_template_id)]"/>
  31. <field name="contract_line_id"
  32. attrs="{'invisible': [('is_contract', '=', False)]}"
  33. domain="[('contract_id','=',contract_id)]"/>
  34. <field name="is_auto_renew"
  35. invisible="1"/>
  36. </xpath>
  37. <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']/parent::group"
  38. position="after">
  39. <field name="is_contract" invisible="1"/>
  40. <separator colspan="4" string="Recurrence Invoicing"
  41. attrs="{'invisible': [('is_contract', '=', False)]}"/>
  42. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  43. <label for="recurring_interval"/>
  44. <div>
  45. <field name="recurring_interval"
  46. class="oe_inline" nolabel="1"/>
  47. <field name="recurring_rule_type"
  48. class="oe_inline" nolabel="1"/>
  49. </div>
  50. </group>
  51. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  52. <field name="recurring_invoicing_type"
  53. attrs="{'invisible': [('recurring_rule_type', '=', 'monthlylastday')]}"/>
  54. </group>
  55. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  56. <field name="date_start"
  57. attrs="{'required': [('is_contract', '=', True)]}"/>
  58. </group>
  59. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  60. <field name="date_end"
  61. attrs="{'required': [('is_auto_renew', '=', True)]}"/>
  62. </group>
  63. </xpath>
  64. <xpath expr="//field[@name='order_line']/tree//field[@name='price_total']"
  65. position="after">
  66. <field name="date_start"
  67. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  68. <field name="date_end"
  69. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  70. </xpath>
  71. <xpath expr="//field[@name='order_line']/tree"
  72. position="attributes">
  73. <attribute name="editable"/>
  74. </xpath>
  75. </field>
  76. </record>
  77. </odoo>