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.

86 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. ]"/>
  42. <field name="contract_line_id"
  43. attrs="{'invisible': [('is_contract', '=', False)]}"
  44. domain="[('contract_id','=',contract_id)]"/>
  45. </xpath>
  46. <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']/parent::group"
  47. position="after">
  48. <field name="is_contract" invisible="1"/>
  49. <separator colspan="4" string="Recurrence Invoicing"
  50. attrs="{'invisible': [('is_contract', '=', False)]}"/>
  51. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  52. <field name="recurring_rule_type"/>
  53. </group>
  54. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  55. <field name="recurring_invoicing_type"
  56. attrs="{'invisible': [('recurring_rule_type', '=', 'monthlylastday')]}"/>
  57. </group>
  58. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  59. <field name="date_start"
  60. attrs="{'required': [('is_contract', '=', True)]}"/>
  61. </group>
  62. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  63. <field name="date_end" attrs="{'required': [('is_contract', '=', True)]}"/>
  64. </group>
  65. </xpath>
  66. <xpath expr="//field[@name='order_line']/tree//field[@name='price_total']"
  67. position="after">
  68. <field name="date_start"
  69. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  70. <field name="date_end"
  71. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  72. </xpath>
  73. <xpath expr="//field[@name='order_line']/tree"
  74. position="attributes">
  75. <attribute name="editable"/>
  76. </xpath>
  77. </field>
  78. </record>
  79. </odoo>