Skip to content
Snippets Groups Projects
Commit 0edd3ea5 authored by Jorge Pinna Puissant's avatar Jorge Pinna Puissant
Browse files

[FIX] base_address_city: lost information when creating Partner from Lead

Have a Lead with the contact informations (Customer Name, Street,
Street 2, City, State, ZIP, Country) completed in the 'Followup' page.

Before this commit, when the base_adress_city module was installed, the
informations of the City, State and ZIP where lost when we try to create
a new Partner from the Lead.

Now, the informations are present in the Partner form; furthermore if
the country allows enforce cities, the information is also present in
the enforce city form.

OPW-1932018

closes odoo/odoo#30644
parent b6f11ace
No related branches found
No related tags found
No related merge requests found
......@@ -15,9 +15,10 @@ class Partner(models.Model):
@api.onchange('city_id')
def _onchange_city_id(self):
self.city = self.city_id.name
self.zip = self.city_id.zipcode
self.state_id = self.city_id.state_id
if self.city_id:
self.city = self.city_id.name
self.zip = self.city_id.zipcode
self.state_id = self.city_id.state_id
@api.model
def _fields_view_get_address(self, arch):
......@@ -37,7 +38,10 @@ class Partner(models.Model):
}"
/>
<field name='city_id' placeholder="%(placeholder)s" string="%(placeholder)s"
context="{'default_country_id': country_id}"
context="{'default_country_id': country_id,
'default_name': city,
'default_zipcode': zip,
'default_state_id': state_id}"
domain="[('country_id', '=', country_id)]"
attrs="{
'invisible': [('country_enforce_cities', '=', False)],
......
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