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.4 KiB

10 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record id="form_res_partner_relation" model="ir.ui.view">
  5. <field name="model">res.partner.relation</field>
  6. <field type="xml" name="arch">
  7. <form string="Partner Relation">
  8. <sheet>
  9. <field name="left_partner_id" />
  10. <field name="type_id" />
  11. <field name="right_partner_id" />
  12. </sheet>
  13. </form>
  14. </field>
  15. </record>
  16. <record id="tree_res_partner_relation" model="ir.ui.view">
  17. <field name="model">res.partner.relation</field>
  18. <field name="arch" type="xml">
  19. <tree
  20. string="Partner Relations"
  21. colors="gray:date_end and date_end &lt; current_date or not active;blue:date_start &gt; current_date"
  22. editable="top"
  23. >
  24. <field
  25. name="left_partner_id"
  26. options="{'create': false, 'create_edit': false}"
  27. />
  28. <field
  29. name="type_selection_id"
  30. required="True"
  31. options="{'create': false, 'create_edit': false}"/>
  32. <field
  33. name="right_partner_id"
  34. options="{'create': false, 'create_edit': false}"
  35. />
  36. <field name="date_start" />
  37. <field name="date_end" />
  38. <field name="active" />
  39. </tree>
  40. </field>
  41. </record>
  42. <record id="search_res_partner_relation" model="ir.ui.view">
  43. <field name="model">res.partner.relation</field>
  44. <field name="arch" type="xml">
  45. <search string="Search Relations">
  46. <field name="any_partner_id" widget="many2one"/>
  47. <field name="left_partner_id"/>
  48. <field name="right_partner_id"/>
  49. <field name="type_id"/>
  50. <field name="active"/>
  51. <group expand="0" string="Group By">
  52. <filter string="Left Partner" context="{'group_by': 'left_partner_id'}"/>
  53. <filter string="Right Partner" context="{'group_by': 'right_partner_id'}"/>
  54. <filter string="Relationship Type" context="{'group_by': 'type_id'}"/>
  55. </group>
  56. </search>
  57. </field>
  58. </record>
  59. <record id="action_res_partner_relation" model="ir.actions.act_window">
  60. <field name="name">Relations</field>
  61. <field name="res_model">res.partner.relation</field>
  62. <field name="view_type">form</field>
  63. <field name="view_mode">tree</field>
  64. <field name="view_id" ref="tree_res_partner_relation"/>
  65. <field name="search_view_id" ref="search_res_partner_relation"/>
  66. <field name="domain">[('active', '=', True)]</field>
  67. <field name="help" type="html">
  68. <p class="oe_view_nocontent_create">
  69. Record and track your partners' relations. Relations may be linked to other partners with a type either directly or inversely.
  70. </p>
  71. </field>
  72. </record>
  73. <record id="action_show_right_relation_partners" model="ir.actions.server">
  74. <field name="sequence" eval="5"/>
  75. <field name="state">code</field>
  76. <field name="type">ir.actions.server</field>
  77. <field name="model_id" ref="model_res_partner_relation"/>
  78. <field name="code">action = self.get_action_related_partners(cr, uid, context.get('active_ids', []), dict(context or {}, partner_relations_show_side='right'))</field>
  79. <field name="condition">True</field>
  80. <field name="name">Show partners</field>
  81. </record>
  82. <record id="action_show_right_relation_partners_value" model="ir.values">
  83. <field name="name">Show partners</field>
  84. <field name="key">action</field>
  85. <field name="key2">client_action_multi</field>
  86. <field name="model">res.partner.relation.all</field>
  87. <field name="value" eval="'ir.actions.server,%d' % ref('partner_relations.action_show_right_relation_partners')" />
  88. </record>
  89. </data>
  90. </openerp>