Hello Yannick Vaucher,
We have tried replacing Contact form with xpath:
<record id="view_partner_form_usedefault_form_for_contacts" model="ir.ui.view"> <field name="name">res.partner.form</field> <field name="model">res.partner</field> <field eval="1" name="priority"/> <field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <xpath expr="//notebook/page[@string='Contacts']/field[@name='child_ids']/form[@string='Contact']" position="replace" > <form string="Contact"></form> </xpath> </field> </record>
by above view, we are able to replace Contact form. We prefer to use xpath while working with internal views.
But some fields of Contact form are inherited in sales module, so in this case we also have to remove that inheritance from sales module:
<record id="sale.res_partner_address_type" model="ir.ui.view"> <field name="name">res.partner.view.address_type</field> <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form" /> <field name="arch" type="xml"> <xpath expr="//label[@for='type']" position="attributes"> <attribute name="groups">sale.group_delivery_invoice_address</attribute> <attribute name="invisible">False</attribute> </xpath> <xpath expr="//div[@name='div_type']" position="attributes"> <attribute name="invisible">False</attribute> <attribute name="groups">sale.group_delivery_invoice_address</attribute> </xpath> <!-- Version-specific hacks to avoid breaking view inheritance when the sale module is installed on top of an older 7.0 version of the base module (as the second embedded div_type was added later in the 7.0 release) TODO: remove the hacks in trunk --> <!-- comment out or remove below two xpath attributes --> <!-- <xpath expr="//div[@name='div_type'][field[@name='use_parent_address']] | //field[@name='child_ids']//div[@name='div_type']" position="attributes"> --> <!-- <attribute name="invisible">False</attribute> --> <!-- <attribute name="groups">sale.group_delivery_invoice_address</attribute> --> <!-- </xpath> --> <!-- <xpath expr="//label[@for='type'][following-sibling::div[@name='div_type']/field[@name='use_parent_address']] | //field[@name='child_ids']//label[@for='type']" position="attributes"> --> <!-- <attribute name="invisible">False</attribute> --> <!-- <attribute name="groups">sale.group_delivery_invoice_address</attribute> --> <!-- </xpath> --> </field> </record>
Hope this helps.
Thanks and Regards, Kalpana Hemnani, Serpent Consulting Services Pvt. Ltd.
Hello Yannick Vaucher,
We have tried replacing Contact form with xpath:
<record id="view_ partner_ form_usedefault _form_for_ contacts" model="ir.ui.view"> >res.partner. form</field> >res.partner< /field> view_partner_ form"/> /notebook/ page[@string= 'Contacts' ]/field[ @name=' child_ids' ]/form[ @string= 'Contact' ]" position="replace" >
<form string= "Contact" ></form>
</ xpath>
<field name="name"
<field name="model"
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.
<field name="arch" type="xml">
<xpath expr="/
</field>
</record>
by above view, we are able to replace Contact form. We prefer to use xpath while working with internal views.
But some fields of Contact form are inherited in sales module, so in this case we also have to remove that inheritance from sales module:
<record id="sale. res_partner_ address_ type" model="ir.ui.view"> >res.partner. view.address_ type</field> >res.partner< /field> view_partner_ form" />
<xpath expr="/ /label[ @for='type' ]" position= "attributes" >
< attribute name="groups" >sale.group_ delivery_ invoice_ address< /attribute>
< attribute name="invisible ">False< /attribute>
</xpath>
<xpath expr="/ /div[@name= 'div_type' ]" position= "attributes" >
< attribute name="invisible ">False< /attribute>
< attribute name="groups" >sale.group_ delivery_ invoice_ address< /attribute>
</xpath>
<!-- Version-specific hacks to avoid breaking view inheritance when the sale module
is installed on top of an older 7.0 version of the base module
(as the second embedded div_type was added later in the 7.0 release)
TODO: remove the hacks in trunk --> /div[@name= 'div_type' ][field[ @name=' use_parent_ address' ]] | //field[ @name=' child_ids' ]//div[ @name=' div_type' ]" position= "attributes" > --> ">False< /attribute> --> >sale.group_ delivery_ invoice_ address< /attribute> --> /label[ @for='type' ][following- sibling: :div[@name= 'div_type' ]/field[ @name=' use_parent_ address' ]] | //field[ @name=' child_ids' ]//label[ @for='type' ]" position= "attributes" > --> ">False< /attribute> --> >sale.group_ delivery_ invoice_ address< /attribute> -->
</ field>
<field name="name"
<field name="model"
<field name="inherit_id" ref="base.
<field name="arch" type="xml">
<!-- comment out or remove below two xpath attributes -->
<!-- <xpath expr="/
<!-- <attribute name="invisible
<!-- <attribute name="groups"
<!-- </xpath> -->
<!-- <xpath expr="/
<!-- <attribute name="invisible
<!-- <attribute name="groups"
<!-- </xpath> -->
</record>
Hope this helps.
Thanks and Regards,
Kalpana Hemnani,
Serpent Consulting Services Pvt. Ltd.