It seems to work now.
We put this code in a custom module :
class website_pt(orm.Model):
_inherit = 'website'
def sale_get_order(self, cr, uid, ids, force_create=False, code=None, update_pricelist=None, context=None):
sale_order_obj = self.pool['sale.order']
sale_order_id = request.session.get('sale_order_id')
sale_order = None
# Cette partie a ete ajoutee afin que le panier se conserve quand un utilisateur revient.
# https://github.com/odoo/odoo/issues/3339
if not sale_order_id:
partner = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context).partner_id
if partner and partner.id != 4: #(4 est le id du public user partner)
domain = [('partner_id','=',partner.id), ('state','=','draft')]
sale_order_id = sale_order_obj.search(cr, SUPERUSER_ID, domain, limit=1, context=context)
To override this code of the file odoo-8.0-20161109/openerp/addons/website_sale/models/sale_order.py :
class website(orm.Model):
_inherit = 'website'
def sale_get_order(self, cr, uid, ids, force_create=False, code=None, update_pricelist=None, context=None):
sale_order_obj = self.pool['sale.order']
sale_order_id = request.session.get('sale_order_id')
sale_order = None
Source : https://github.com/odoo/odoo/issues/3339
I have tested with a new clean server. No custom module. Just installed ecommerce module. The cart doesn't seem to be persistent... How could I solve it?