Skip to content
Snippets Groups Projects
Commit 7dd34412 authored by Laurent Smet's avatar Laurent Smet Committed by qdp-odoo
Browse files

[FIX] base_address_city: fix city field duplication (#17919)

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 https://github.com/odoo/odoo/pull/16870 for screenshots
parent 936f3988
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ class Partner(models.Model):
@api.model
def _fields_view_get_address(self, arch):
arch = super(Partner, self)._fields_view_get_address(arch)
if not self._context.get('no_address_format'):
return arch
# render the partner address accordingly to address_view_id
doc = etree.fromstring(arch)
for city_node in doc.xpath("//field[@name='city']"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment