summaryrefslogtreecommitdiff
path: root/addons/website_sale_wishlist/models/res_users.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website_sale_wishlist/models/res_users.py')
-rw-r--r--addons/website_sale_wishlist/models/res_users.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/website_sale_wishlist/models/res_users.py b/addons/website_sale_wishlist/models/res_users.py
new file mode 100644
index 00000000..d1887d17
--- /dev/null
+++ b/addons/website_sale_wishlist/models/res_users.py
@@ -0,0 +1,13 @@
+from odoo import api, fields, models
+from odoo.http import request
+
+
+class ResUsers(models.Model):
+ _inherit = "res.users"
+
+ def _check_credentials(self, password, env):
+ """Make all wishlists from session belong to its owner user."""
+ result = super(ResUsers, self)._check_credentials(password, env)
+ if request and request.session.get('wishlist_ids'):
+ self.env["product.wishlist"]._check_wishlist_from_session()
+ return result