Browse Source

[ENH] Module partner_relations:

- Edit relations in pop-up form instead of through inline tree.
pull/103/head
Ronald Portier 10 years ago
committed by Sandy Carter
parent
commit
879e421368
  1. 50
      partner_relations/view/res_partner.xml

50
partner_relations/view/res_partner.xml

@ -1,6 +1,7 @@
<openerp> <openerp>
<data> <data>
<record id="view_res_partner_filter" model="ir.ui.view"> <record id="view_res_partner_filter" model="ir.ui.view">
<field name="name">partner_relations.view_partner_filter</field>
<field name="inherit_id" ref="base.view_res_partner_filter" /> <field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field type="xml" name="arch"> <field type="xml" name="arch">
@ -15,6 +16,7 @@
</field> </field>
</record> </record>
<record id="view_partner_form" model="ir.ui.view"> <record id="view_partner_form" model="ir.ui.view">
<field name="name">partner_relations.view_partner_form</field>
<field name="inherit_id" ref="base.view_partner_form" /> <field name="inherit_id" ref="base.view_partner_form" />
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field type="xml" name="arch"> <field type="xml" name="arch">
@ -30,7 +32,6 @@
}" }"
> >
<tree <tree
editable="top"
colors="gray:is_relation_expired==True or not active;blue:is_relation_future==True" colors="gray:is_relation_expired==True or not active;blue:is_relation_future==True"
> >
<field <field
@ -79,6 +80,53 @@
invisible="True" invisible="True"
/> />
</tree> </tree>
<form>
<field
name="type_selection_id"
required="True"
context="{
'parent_model': 'res.partner',
'parent_id': parent.id,
}"
domain="[
'|',
('contact_type_this', '=', parent.is_company and 'c' or 'p'),
('contact_type_this', '=', False),
('search_partner_category_this', '=', parent.category_id),
]
"
options="{'create': false, 'create_edit': false}"
on_change="on_change_type_selection_id(type_selection_id)"
/>
<field name="type_id" invisible="True" />
<field
name="partner_id_display"
required="True"
attrs="{
'readonly': [('type_selection_id','=',False)],
}"
options="{'create': false, 'create_edit': false}"
widget="many2one_clickable"
/>
<field
name="date_start"
/>
<field
name="date_end"
/>
<field
name="active"
/>
<field
name="is_relation_expired"
invisible="True"
/>
<field
name="is_relation_future"
invisible="True"
/>
</form>
</field> </field>
</page> </page>
</xpath> </xpath>

Loading…
Cancel
Save