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.

94 lines
4.2 KiB

  1. <?xml version="1.0"?>
  2. <odoo>
  3. <!-- Agreement Recital List View-->
  4. <record model="ir.ui.view" id="agreement_recital_tree">
  5. <field name="name">Agreement Recital Tree</field>
  6. <field name="model">agreement.recital</field>
  7. <field name="arch" type="xml">
  8. <tree string="Recitals" 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 Recital Form View -->
  18. <record model="ir.ui.view" id="agreement_recital_form">
  19. <field name="name">Agreement Recital Form</field>
  20. <field name="model">agreement.recital</field>
  21. <field name="arch" type="xml">
  22. <form string="Recital">
  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. <field name="content" widget="html"/>
  43. <group class="oe_edit_only">
  44. <group>
  45. <field name="field_id"
  46. domain="[('model_id', '=', active_model),
  47. ('ttype', '!=', 'one2many'),
  48. ('ttype', '!=', 'many2many')]"/>
  49. <field name="sub_object_id" readonly="1"/>
  50. <field name="sub_model_object_field_id"
  51. domain="[('model_id', '=', sub_object_id),
  52. ('ttype', '!=', 'one2many'),
  53. ('ttype', '!=', 'many2many')]"
  54. attrs="{'readonly':[('sub_object_id', '=', False)],
  55. 'required':[('sub_object_id', '!=', False)]}"/>
  56. <field name="default_value"/>
  57. <field name="copyvalue"/>
  58. </group>
  59. <p>
  60. This section (on the left) allows you to add dynamic fields inside the content.
  61. <ol>
  62. <li>Select the recital field</li>
  63. <li>Select the sub-field</li>
  64. <li>Enter the default value if the field is empty</li>
  65. <li>Copy and paste the placeholder expression in the content</li>
  66. </ol>
  67. </p>
  68. </group>
  69. </sheet>
  70. </form>
  71. </field>
  72. </record>
  73. <!-- Agreement Recital Search View -->
  74. <record model="ir.ui.view" id="agreement_recital_search">
  75. <field name="name">Agreement Recital Search</field>
  76. <field name="model">agreement.recital</field>
  77. <field name="arch" type="xml">
  78. <search>
  79. <filter name="group_agreement" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
  80. </search>
  81. </field>
  82. </record>
  83. <!-- Actions opening views on models -->
  84. <record model="ir.actions.act_window" id="agreement_recital_action">
  85. <field name="name">Recitals</field>
  86. <field name="res_model">agreement.recital</field>
  87. <field name="view_mode">tree,form</field>
  88. </record>
  89. </odoo>