[FIX] website_sale: add to cart product => quantity + 1
bzr revid: chm@openerp.com-20140502150842-nitu8tsxd02e6dnh
This commit is contained in:
parent
c10800f2f1
commit
bbfdc57ad9
|
@ -228,7 +228,7 @@ class website_sale(http.Controller):
|
|||
return request.website.render("website_sale.cart", values)
|
||||
|
||||
@http.route(['/shop/cart/update'], type='http', auth="public", methods=['POST'], website=True, multilang=True)
|
||||
def cart_update(self, product_id, add_qty=0, set_qty=0, **kw):
|
||||
def cart_update(self, product_id, add_qty=1, set_qty=0, **kw):
|
||||
cr, uid, context = request.cr, request.uid, request.context
|
||||
request.website.sale_get_order(force_create=1)._cart_update(product_id=int(product_id), add_qty=add_qty, set_qty=set_qty)
|
||||
return request.redirect("/shop/cart")
|
||||
|
|
|
@ -86,6 +86,8 @@ class sale_order(osv.Model):
|
|||
if not line_id:
|
||||
values = self._website_product_id_change(cr, uid, ids, so.id, product_id, context=context)
|
||||
line_id = sol.create(cr, SUPERUSER_ID, values, context=context)
|
||||
if add_qty:
|
||||
add_qty -= 1
|
||||
|
||||
# compute new quantity
|
||||
if set_qty:
|
||||
|
|
Loading…
Reference in New Issue