mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 20:52:07 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -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')
|
||||
Loading…
Add table
Add a link
Reference in a new issue