diff options
| author | Denis Ledoux <dle@openerp.com> | 2014-01-30 20:37:06 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@openerp.com> | 2014-01-30 20:37:06 +0100 |
| commit | f85065930eb612456bada99b7f5492f3a6036868 (patch) | |
| tree | ac585720395476ee2a7b5ed5a97f18b52ad8700a /addons/website_customer/controllers | |
| parent | 211f3b74b82333972e57ec3c9d4f7c5f38e358cd (diff) | |
[FIX]website_customer, website_crm_partner_assign: keep search if jump between countries, and keep countries if do a new search.
bzr revid: dle@openerp.com-20140130193706-xxn668p2edr69zue
Diffstat (limited to 'addons/website_customer/controllers')
| -rw-r--r-- | addons/website_customer/controllers/main.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index 9e026c135a2..2ee5e446c5d 100644 --- a/addons/website_customer/controllers/main.py +++ b/addons/website_customer/controllers/main.py @@ -8,7 +8,6 @@ from openerp.addons.web.http import request from openerp.addons.website_partner.controllers import main as website_partner import werkzeug.urls - class WebsiteCustomer(http.Controller): _references_per_page = 20 @@ -22,6 +21,7 @@ class WebsiteCustomer(http.Controller): ], type='http', auth="public", website=True, multilang=True) def customers(self, country_id=0, page=0, **post): cr, uid, context = request.cr, request.uid, request.context + country_obj = request.registry['res.country'] partner_obj = request.registry['res.partner'] partner_name = post.get('search', '') @@ -47,6 +47,13 @@ class WebsiteCustomer(http.Controller): if country_id: domain += [('country_id', '=', country_id)] + if not any(x['country_id'][0] == country_id for x in countries): + country = country_obj.browse(cr, uid, country_id, context) + countries.append({ + 'country_id_count': 0, + 'country_id': (country_id, country.name) + }) + countries.sort(key=lambda d: d['country_id'][1]) # search customers to display partner_ids = partner_obj.search(cr, openerp.SUPERUSER_ID, domain, context=request.context) |
