Odoo18-Base/addons/website_sale_wishlist/models/res_users.py

14 lines
465 B
Python
Raw Permalink Normal View History

2025-01-06 10:57:38 +07:00
from odoo import api, fields, models
from odoo.http import request
class ResUsers(models.Model):
_inherit = "res.users"
def _check_credentials(self, credential, env):
"""Make all wishlists from session belong to its owner user."""
result = super()._check_credentials(credential, env)
if request and request.session.get('wishlist_ids'):
self.env["product.wishlist"]._check_wishlist_from_session()
return result