mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 15:12:02 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -1,7 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.http import request
|
||||
from odoo.tools import lazy
|
||||
|
||||
|
||||
class IrHttp(models.AbstractModel):
|
||||
|
|
@ -13,3 +14,21 @@ class IrHttp(models.AbstractModel):
|
|||
affiliate_id = request.httprequest.args.get('affiliate_id')
|
||||
if affiliate_id:
|
||||
request.session['affiliate_id'] = int(affiliate_id)
|
||||
|
||||
@api.model
|
||||
def get_frontend_session_info(self):
|
||||
session_info = super().get_frontend_session_info()
|
||||
session_info.update({
|
||||
'add_to_cart_action': request.website.add_to_cart_action,
|
||||
})
|
||||
return session_info
|
||||
|
||||
@classmethod
|
||||
def _frontend_pre_dispatch(cls):
|
||||
super()._frontend_pre_dispatch()
|
||||
|
||||
# lazy to make sure those are only evaluated when requested
|
||||
# All those records are sudoed !
|
||||
request.cart = lazy(request.website._get_and_cache_current_cart)
|
||||
request.fiscal_position = lazy(request.website._get_and_cache_current_fiscal_position)
|
||||
request.pricelist = lazy(request.website._get_and_cache_current_pricelist)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue