[FIX] res.partner form view: inherited view now hides `use_parent_address` on top...
authorOlivier Dony <odo@openerp.com>
Wed, 10 Apr 2013 17:04:37 +0000 (19:04 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 10 Apr 2013 17:04:37 +0000 (19:04 +0200)
The `use_parent_address` flag is meant for advanced use
in companies that want to make sure their contact/company
addresses are always in sync, at the possible cost of some
usability loss when editing existing addresses (need to
open the company form view, contact fields are read-only).

The embedded mini-form view of the contacts also need to
be inherited to make it match the main view.

bzr revid: odo@openerp.com-20130410170437-2v4ehptknk6yf1x2

addons/sale/res_partner_view.xml

index 54a9813..40ac119 100644 (file)
             <field name="arch" type="xml">
                 <xpath expr="//label[@for='type']" position="attributes">
                     <attribute name="groups">sale.group_delivery_invoice_address</attribute>
-                </xpath>
-                <xpath expr="//label[@for='type']" position="attributes">
                     <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>
-                <xpath expr="//div[@name='div_type']" position="attributes">
+                <xpath expr="//field[@name='use_parent_address']" position="attributes">
+                    <attribute name="invisible">False</attribute>
+                    <attribute name="groups">sale.group_delivery_invoice_address</attribute>
+                </xpath>
+                <xpath expr="//label[@for='use_parent_address']" position="attributes">
+                    <attribute name="invisible">False</attribute>
+                    <attribute name="groups">sale.group_delivery_invoice_address</attribute>
+                </xpath>
+                <xpath expr="//field[@name='child_ids']//field[@name='use_parent_address']" position="attributes">
+                    <attribute name="invisible">False</attribute>
+                    <attribute name="groups">sale.group_delivery_invoice_address</attribute>
+                </xpath>
+                <xpath expr="//field[@name='child_ids']//label[@for='use_parent_address']" position="attributes">
+                    <attribute name="invisible">False</attribute>
+                    <attribute name="groups">sale.group_delivery_invoice_address</attribute>
+                </xpath>
+                <xpath expr="//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="//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>