[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
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user