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.

109 lines
5.3 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Agreement Sections List View-->
  4. <record model="ir.ui.view" id="partner_agreement_section_list_view">
  5. <field name="name">Agreement Section List</field>
  6. <field name="model">agreement.section</field>
  7. <field name="arch" type="xml">
  8. <tree string="Sections" default_order='agreement_id, sequence'>
  9. <field name="sequence" widget="handle"/>
  10. <field name="name"/>
  11. <field name="title"/>
  12. <field name="agreement_id"/>
  13. <field name="active" invisible="1"/>
  14. </tree>
  15. </field>
  16. </record>
  17. <!-- Agreement Sections Form View -->
  18. <record model="ir.ui.view" id="partner_agreement_section_form_view">
  19. <field name="name">Agreement Section Form</field>
  20. <field name="model">agreement.section</field>
  21. <field name="arch" type="xml">
  22. <form string="Section">
  23. <sheet>
  24. <div class="oe_button_box" name="button_box">
  25. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
  26. <field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
  27. </button>
  28. </div>
  29. <div class="oe_title">
  30. <label for="name" class="oe_edit_only"/>
  31. <h1><field name="name"/></h1>
  32. </div>
  33. <group>
  34. <group>
  35. <field name="title"/>
  36. <field name="agreement_id"/>
  37. </group>
  38. <group>
  39. <field name="sequence"/>
  40. </group>
  41. </group>
  42. <notebook>
  43. <page string="Content">
  44. <field name='content' nolabel="1"/>
  45. <group class="oe_edit_only">
  46. <group>
  47. <field name="field_id"
  48. domain="[('model_id', '=', active_model),
  49. ('ttype', '!=', 'one2many'),
  50. ('ttype', '!=', 'many2many')]"/>
  51. <field name="sub_object_id" readonly="1"/>
  52. <field name="sub_model_object_field_id"
  53. domain="[('model_id', '=', sub_object_id),
  54. ('ttype', '!=', 'one2many'),
  55. ('ttype', '!=', 'many2many')]"
  56. attrs="{'readonly':[('sub_object_id', '=', False)],
  57. 'required':[('sub_object_id', '!=', False)]}"/>
  58. <field name="default_value"/>
  59. <field name="copyvalue"/>
  60. </group>
  61. <p>
  62. This section (on the left) allows you to add dynamic fields inside the content.
  63. <ol>
  64. <li>Select the section field</li>
  65. <li>Select the sub-field</li>
  66. <li>Enter the default value if the field is empty</li>
  67. <li>Copy and paste the placeholder expression in the content</li>
  68. </ol>
  69. </p>
  70. </group>
  71. </page>
  72. <page string="Clauses">
  73. <field name="clauses_ids"
  74. nolabel="1"
  75. context="{'default_section_id': active_id, 'default_agreement_id': agreement_id}">
  76. <tree>
  77. <field name="sequence" widget="handle"/>
  78. <field name="name"/>
  79. <field name="title"/>
  80. </tree>
  81. </field>
  82. </page>
  83. </notebook>
  84. </sheet>
  85. </form>
  86. </field>
  87. </record>
  88. <!-- Agreement Section Search View -->
  89. <record model="ir.ui.view" id="partner_agreement_section_search_view">
  90. <field name="name">Agreement Section Search</field>
  91. <field name="model">agreement.section</field>
  92. <field name="arch" type="xml">
  93. <search string="Agreement Section Search">
  94. <filter name="group_agreement" string="Agreements" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
  95. </search>
  96. </field>
  97. </record>
  98. <!-- Actions opening views on models -->
  99. <record model="ir.actions.act_window" id="partner_agreement_action_section">
  100. <field name="name">Agreement Sections</field>
  101. <field name="res_model">agreement.section</field>
  102. <field name="view_mode">tree,form</field>
  103. </record>
  104. </odoo>