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.

132 lines
6.9 KiB

  1. <openerp>
  2. <data>
  3. <record id="view_res_partner_filter" model="ir.ui.view">
  4. <field name="name">partner_relations.view_partner_filter</field>
  5. <field name="inherit_id" ref="base.view_res_partner_filter" />
  6. <field name="model">res.partner</field>
  7. <field type="xml" name="arch">
  8. <data>
  9. <field name="parent_id" position="after">
  10. <field name="search_relation_partner_id" />
  11. <field name="search_relation_id" />
  12. <field name="search_relation_date" />
  13. <field name="search_relation_partner_category_id" />
  14. </field>
  15. </data>
  16. </field>
  17. </record>
  18. <record id="view_partner_form" model="ir.ui.view">
  19. <field name="name">partner_relations.view_partner_form</field>
  20. <field name="inherit_id" ref="base.view_partner_form" />
  21. <field name="model">res.partner</field>
  22. <field type="xml" name="arch">
  23. <data>
  24. <xpath expr="//sheet/notebook" position="inside">
  25. <page string="Relations">
  26. <field
  27. name="relation_ids"
  28. context="{
  29. 'active_model': 'res.partner',
  30. 'active_id': id, 'active_ids': [id],
  31. 'active_test': False,
  32. }"
  33. >
  34. <tree
  35. colors="gray:is_relation_expired==True or not active;blue:is_relation_future==True"
  36. >
  37. <field
  38. name="type_selection_id"
  39. required="True"
  40. context="{
  41. 'parent_model': 'res.partner',
  42. 'parent_id': parent.id,
  43. }"
  44. domain="[
  45. '|',
  46. ('contact_type_this', '=', parent.is_company and 'c' or 'p'),
  47. ('contact_type_this', '=', False),
  48. ('search_partner_category_this', '=', parent.category_id),
  49. ]
  50. "
  51. options="{'create': false, 'create_edit': false}"
  52. on_change="on_change_type_selection_id(type_selection_id)"
  53. />
  54. <field name="type_id" invisible="True" />
  55. <field
  56. name="partner_id_display"
  57. required="True"
  58. attrs="{
  59. 'readonly': [('type_selection_id','=',False)],
  60. }"
  61. options="{'create': false, 'create_edit': false}"
  62. widget="many2one_clickable"
  63. />
  64. <field name="date_start" />
  65. <field name="date_end" />
  66. <field name="active" />
  67. <field
  68. name="is_relation_expired"
  69. invisible="True"
  70. />
  71. <field
  72. name="is_relation_future"
  73. invisible="True"
  74. />
  75. </tree>
  76. <form>
  77. <field
  78. name="type_selection_id"
  79. required="True"
  80. context="{
  81. 'parent_model': 'res.partner',
  82. 'parent_id': parent.id,
  83. }"
  84. domain="[
  85. '|',
  86. ('contact_type_this', '=', parent.is_company and 'c' or 'p'),
  87. ('contact_type_this', '=', False),
  88. ('search_partner_category_this', '=', parent.category_id),
  89. ]
  90. "
  91. options="{'create': false, 'create_edit': false}"
  92. on_change="on_change_type_selection_id(type_selection_id)"
  93. />
  94. <field name="type_id" invisible="True" />
  95. <field
  96. name="partner_id_display"
  97. required="True"
  98. attrs="{
  99. 'readonly': [('type_selection_id','=',False)],
  100. }"
  101. options="{'create': false, 'create_edit': false}"
  102. widget="many2one_clickable"
  103. />
  104. <field name="date_start" />
  105. <field name="date_end" />
  106. <field name="active" />
  107. <field
  108. name="is_relation_expired"
  109. invisible="True"
  110. />
  111. <field
  112. name="is_relation_future"
  113. invisible="True"
  114. />
  115. </form>
  116. </field>
  117. </page>
  118. </xpath>
  119. </data>
  120. </field>
  121. </record>
  122. <act_window id="action_show_partner_relations"
  123. name="Show partner's relations"
  124. src_model="res.partner"
  125. res_model="res.partner.relation.all"
  126. domain="[('this_partner_id', 'in', active_ids)]"
  127. key2="client_action_multi" />
  128. </data>
  129. </openerp>