Skip to content
Snippets Groups Projects
Commit 165d13bd authored by Laurent Smet's avatar Laurent Smet
Browse files

[FIX] base_address_city: avoid city_id field duplication

In base/res_partner.py, _fields_view_get calls _fields_view_get_address that could calls again
_fields_view_get in case of address_view_id is specified. That leads to issue in base_address_city
because the _fields_view_get_address method will replace two times the city field and then, we get
a view with two city_id fields.

see #16870 for screenshots
parent 13b25fed
Branches
Tags
No related merge requests found
......@@ -22,6 +22,8 @@ class Partner(models.Model):
arch = super(Partner, self)._fields_view_get_address(arch)
# render the partner address accordingly to address_view_id
doc = etree.fromstring(arch)
if doc.xpath("//field[@name='city_id']"):
return arch
for city_node in doc.xpath("//field[@name='city']"):
replacement_xml = """
<div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment