Skip to content
Permalink
Browse files

[FIX]CRM: Onchange for only show the states of an especific conutry i…

…n opportunities.
  • Loading branch information...
IsabelEsparza committed Mar 20, 2019
1 parent 716ff76 commit 66465a329ea8bc5d18f1b2038e9a5e4648edf175
Showing with 7 additions and 0 deletions.
  1. +7 −0 addons/crm/models/crm_lead.py
@@ -277,6 +277,13 @@ def _onchange_state(self):
if self.state_id:
self.country_id = self.state_id.country_id.id

@api.onchange('country_id')
def _onchange_country_id(self):
if self.country_id:
return {'domain': {'state_id': [('country_id', '=', self.country_id.id)]}}
else:
return {'domain': {'state_id': []}}

# ----------------------------------------
# ORM override (CRUD, fields_view_get, ...)
# ----------------------------------------

0 comments on commit 66465a3

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