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.

87 lines
4.1 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="//header" position="inside">
  13. <field name="need_contract_creation" invisible="1"/>
  14. <button name="action_create_contract"
  15. string="Create Contracts"
  16. type="object"
  17. class="oe_highlight" attrs="{'invisible': [('need_contract_creation', '=', False)]}"/>
  18. </xpath>
  19. <xpath expr="//div[@name='button_box']" position="inside">
  20. <button name="action_show_contracts"
  21. type="object" icon="fa-book"
  22. class="oe_stat_button"
  23. attrs="{'invisible': ['|', ('is_contract', '!=', True), ('state', 'not in', ['sale', 'done'])]}">
  24. <field string="Contracts"
  25. name="contract_count"
  26. widget="statinfo"/>
  27. </button>
  28. </xpath>
  29. <xpath expr="//field[@name='order_line']" position="before">
  30. <field name="is_contract" invisible="1"/>
  31. </xpath>
  32. <xpath expr="//field[@name='order_line']/form//field[@name='product_id']"
  33. position="after">
  34. <field name="contract_template_id" invisible="1"/>
  35. <field name="contract_id"
  36. options='{"no_create": True}'
  37. attrs="{'invisible': [('is_contract', '=', False)]}"
  38. domain="['|',('contract_template_id','=',contract_template_id),
  39. ('contract_template_id','=',False),
  40. ('partner_id','=',parent.partner_id),
  41. ('recurring_invoices','=',True),
  42. ]"/>
  43. <field name="contract_line_id"
  44. attrs="{'invisible': [('is_contract', '=', False)]}"
  45. domain="[('contract_id','=',contract_id)]"/>
  46. </xpath>
  47. <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']/parent::group"
  48. position="after">
  49. <field name="is_contract" invisible="1"/>
  50. <separator colspan="4" string="Recurrence Invoicing"
  51. attrs="{'invisible': [('is_contract', '=', False)]}"/>
  52. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  53. <field name="recurring_rule_type"/>
  54. </group>
  55. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  56. <field name="recurring_invoicing_type"
  57. attrs="{'invisible': [('recurring_rule_type', '=', 'monthlylastday')]}"/>
  58. </group>
  59. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  60. <field name="date_start"
  61. attrs="{'required': [('is_contract', '=', True)]}"/>
  62. </group>
  63. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  64. <field name="date_end" attrs="{'required': [('is_contract', '=', True)]}"/>
  65. </group>
  66. </xpath>
  67. <xpath expr="//field[@name='order_line']/tree//field[@name='price_total']"
  68. position="after">
  69. <field name="date_start"
  70. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  71. <field name="date_end"
  72. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  73. </xpath>
  74. <xpath expr="//field[@name='order_line']/tree"
  75. position="attributes">
  76. <attribute name="editable"/>
  77. </xpath>
  78. </field>
  79. </record>
  80. </odoo>