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.

80 lines
3.7 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. options='{"no_create": True}'
  30. attrs="{'invisible': [('is_contract', '=', False)]}"
  31. domain="['|',('contract_template_id','=',contract_template_id),
  32. ('contract_template_id','=',False),
  33. ('partner_id','=',parent.partner_id),
  34. ('recurring_invoices','=',True),
  35. ]"/>
  36. <field name="contract_line_id"
  37. attrs="{'invisible': [('is_contract', '=', False)]}"
  38. domain="[('contract_id','=',contract_id)]"/>
  39. </xpath>
  40. <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']/parent::group"
  41. position="after">
  42. <field name="is_contract" invisible="1"/>
  43. <separator colspan="4" string="Recurrence Invoicing"
  44. attrs="{'invisible': [('is_contract', '=', False)]}"/>
  45. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  46. <field name="recurring_rule_type"/>
  47. </group>
  48. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  49. <field name="recurring_invoicing_type"
  50. attrs="{'invisible': [('recurring_rule_type', '=', 'monthlylastday')]}"/>
  51. </group>
  52. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  53. <field name="date_start"
  54. attrs="{'required': [('is_contract', '=', True)]}"/>
  55. </group>
  56. <group attrs="{'invisible': [('is_contract', '=', False)]}">
  57. <field name="date_end" attrs="{'required': [('is_contract', '=', True)]}"/>
  58. </group>
  59. </xpath>
  60. <xpath expr="//field[@name='order_line']/tree//field[@name='price_total']"
  61. position="after">
  62. <field name="date_start"
  63. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  64. <field name="date_end"
  65. attrs="{'column_invisible': [('parent.is_contract', '=', False)]}"/>
  66. </xpath>
  67. <xpath expr="//field[@name='order_line']/tree"
  68. position="attributes">
  69. <attribute name="editable"/>
  70. </xpath>
  71. </field>
  72. </record>
  73. </odoo>