summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorLaurent Smet <las@openerp.com>2017-10-09 13:53:42 +0200
committerLaurent Smet <las@openerp.com>2017-10-09 14:45:26 +0200
commit165d13bdb5439e4ad78f31dc97ab99a314352d65 (patch)
tree359d87cdf94fca6487ea71c78b28b3a4b1a3cf60 /addons
parent13b25fedbfb817726ac92674c7386c76c23c8c3c (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/base_address_city/models/res_partner.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/base_address_city/models/res_partner.py b/addons/base_address_city/models/res_partner.py
index afa5cd759e8..abf94f02165 100644
--- a/addons/base_address_city/models/res_partner.py
+++ b/addons/base_address_city/models/res_partner.py
@@ -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>