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.

97 lines
4.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. <?xml version="1.0"?>
  2. <odoo>
  3. <!-- Agreement Clause List View-->
  4. <record model="ir.ui.view" id="partner_agreement_clause_list_view">
  5. <field name="name">Agreement Clause List</field>
  6. <field name="model">agreement.clause</field>
  7. <field name="arch" type="xml">
  8. <tree string="Clauses" 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="section_id"/>
  14. <field name="active" invisible="1"/>
  15. </tree>
  16. </field>
  17. </record>
  18. <!-- Agreement Clause Form View -->
  19. <record model="ir.ui.view" id="partner_agreement_clause_form_view">
  20. <field name="name">Agreement clause Form</field>
  21. <field name="model">agreement.clause</field>
  22. <field name="arch" type="xml">
  23. <form string="Clause">
  24. <sheet>
  25. <div class="oe_button_box" name="button_box">
  26. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
  27. <field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
  28. </button>
  29. </div>
  30. <div class="oe_title">
  31. <label for="name" class="oe_edit_only"/>
  32. <h1><field name="name"/></h1>
  33. </div>
  34. <group>
  35. <group>
  36. <field name="title"/>
  37. <field name="agreement_id"/>
  38. <field name="section_id" domain="[('agreement_id', '=', agreement_id)]"/>
  39. </group>
  40. <group>
  41. <field name="sequence"/>
  42. </group>
  43. </group>
  44. <field name="content" widget="html"/>
  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 clause 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. </sheet>
  72. </form>
  73. </field>
  74. </record>
  75. <!-- Agreement Clause Search View -->
  76. <record model="ir.ui.view" id="agreement_clause_search_view">
  77. <field name="name">Agreement Clause Search</field>
  78. <field name="model">agreement.clause</field>
  79. <field name="arch" type="xml">
  80. <search string="Agreement Clause Search">
  81. <filter name="group_agreement" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
  82. <filter name="group_section" icon="terp-partner" context="{'group_by':'section_id'}"/>
  83. </search>
  84. </field>
  85. </record>
  86. <!-- Actions opening views on models -->
  87. <record model="ir.actions.act_window" id="partner_agreement_action_clause">
  88. <field name="name">Clauses</field>
  89. <field name="res_model">agreement.clause</field>
  90. <field name="view_mode">tree,form</field>
  91. </record>
  92. </odoo>