19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -0,0 +1,21 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.http import request, route
from odoo.addons.website_sale.controllers.cart import Cart as WebsiteSaleCart
class Cart(WebsiteSaleCart):
@route()
def cart(self, **post):
if order_sudo := request.cart:
order_sudo._update_programs_and_rewards()
order_sudo._auto_apply_rewards()
return super().cart(**post)
@route('/wallet/top_up', type='http', auth='user', website=True, sitemap=False)
def wallet_top_up(self, **kwargs):
product = self.env['product.product'].browse(int(kwargs['trigger_product_id']))
self.add_to_cart(product.product_tmpl_id.id, product.id, 1)
return request.redirect('/shop/cart')