Skip to content
Snippets Groups Projects
Commit 4881fc91 authored by MerlinGuillaume's avatar MerlinGuillaume
Browse files

[FIX] base_address_city: disable address form edition


An error is thrown when trying to edit fields in the address of a
partner when an address_view_id is set on the company country

Steps to reproduce:
1. Install Contacts, Studio and module l10n_mx_edi_extended
2. Go to Contacts and open any contact
3. Toggle Studio
4. Click on the Zip field in the address
5. Try to edit the label of the field, an error is thrown

Solution:
Render the original view by using the no_adress_format context key

opw-3374394

closes odoo/odoo#126727

Related: odoo/enterprise#43316
Signed-off-by: default avatarGuillaume Merlin (megu) <megu@odoo.com>
parent cf1c7c7b
Branches
Tags
No related merge requests found
......@@ -32,6 +32,8 @@ class Partner(models.Model):
@api.model
def _fields_view_get_address(self, arch):
arch = super(Partner, self)._fields_view_get_address(arch)
if self.env.context.get('no_address_format'):
return arch
# render the partner address accordingly to address_view_id
doc = etree.fromstring(arch)
if doc.xpath("//field[@name='city_id']"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment