diff options
| author | Denis Ledoux <dle@odoo.com> | 2016-01-14 16:19:07 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2016-01-14 16:20:32 +0100 |
| commit | 698c0c557db99ac190946c7b19fbe46990dcd4e0 (patch) | |
| tree | fade76e70e049d417c5f41a7a30d0a15bbce5d24 /addons | |
| parent | 6e1ed6c8bbce29e9cb23e14eab47fe3d1d09c3c9 (diff) | |
[FIX] website_sale: default pricelist
The default pricelist set for visitors
in the ecommerce must be part of the available
pricelists (available according to the country)
The pricelist of the public user may
not amongs the available pricelists.
opw-665536
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_sale/models/sale_order.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index d1d00e67e6c..ab8e7bdb8f4 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -224,7 +224,11 @@ class website(orm.Model): if pl_id: return self.pool['product.pricelist'].browse(cr, uid, [pl_id], context=context)[0] else: - pl = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context).partner_id.property_product_pricelist + available_pricelists = self.get_pricelist_available(cr, uid, context=context) + if available_pricelists: + pl = available_pricelists[0] + else: + pl = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context).partner_id.property_product_pricelist request.session['website_sale_current_pl'] = pl.id return pl |
