[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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user