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