Skip to content
Permalink
Browse files

[FIX] base: _name_search of state

When creating a new customer, the selection list for the state is empty
unless the country is filled in.

This is an issue since users usually fill the address fields in the
sequential order: street, city, state, zip and then country. Since no
state proposal is displayed, users tend to create a new state.

Introduced in 5fcf891.

opw-1941579
  • Loading branch information...
nim-odoo committed Feb 20, 2019
1 parent e632e6c commit e62133f205828643228570ea915a2eaea084a3e3
Showing with 1 addition and 1 deletion.
  1. +1 −1 odoo/addons/base/models/res_country.py
@@ -121,7 +121,7 @@ class CountryState(models.Model):
@api.model
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
args = args or []
if 'country_id' in self.env.context:
if self.env.context.get('country_id'):
args = expression.AND([args, [('country_id', '=', self.env.context.get('country_id'))]])

if operator == 'ilike' and not (name or '').strip():

0 comments on commit e62133f

Please sign in to comment.
You can’t perform that action at this time.