[FIX] base_vat: xpath overrides autocomplete

The xpath used in the res_partner_view replaces the vat field with
a div, containing the partner vat and the VIES valid field (such that
they are displayed on a single row). This results in the
partner-autocomplete being removed from the field.

The solution is to make a div, and a subsequent xpath that moves the
"vat" field into this div (alongside the vies valid field). This no
longer overrides the partner-autocomplete xpath.

closes odoo/odoo#154506

Task-id: none
X-original-commit: ffc8441b4ba09e3d10f15425c32f8fdb3fb7d863
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
Co-authored-by: aliya <alta@odoo.com>
This commit is contained in:
Daniel Kosky (dako)
2024-02-19 10:45:07 +00:00
committed by aliya
co-authored by aliya
parent a4804e0ab9
commit f2545214aa
+10 -6
View File
@@ -6,14 +6,18 @@
<field name="name">view.partner.base.vat.form</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='vat']" position="replace">
<xpath expr="//field[@name='vat']" position="after">
<field name="perform_vies_validation" invisible="1"/>
<label for="vat" string="Tax ID"/>
<div>
<field name="vat" placeholder="e.g. BE0477472701" readonly="parent_id" class="oe_inline"/>
<label for="vies_valid" invisible="not perform_vies_validation"/>
<field name="vies_valid" invisible="not perform_vies_validation"/>
</div>
<div name="vat_vies_container"/>
</xpath>
<xpath expr="//div[@name='vat_vies_container']" position="inside">
<xpath expr="//field[@name='vat']" position="move"/>
<label for="vies_valid" invisible="not perform_vies_validation"/>
<field name="vies_valid" invisible="not perform_vies_validation" class="oe_inline"/>
</xpath>
<xpath expr="//field[@name='vat']" position="attributes">
<attribute name="class" position="add" separator=" ">oe_inline</attribute>
</xpath>
</field>
</record>