| 1 | from odoo import models |
| 2 | from odoo.http import request |
| 3 | |
| 4 | |
| 5 | class ResUsers(models.Model): |
| 6 | _inherit = "res.users" |
| 7 | |
| 8 | def _check_credentials(self, credential, env): |
| 9 | """Make all wishlists from session belong to its owner user.""" |
| 10 | result = super()._check_credentials(credential, env) |
| 11 | if request and request.session.get('wishlist_ids'): |
| 12 | self.env["product.wishlist"]._check_wishlist_from_session() |
| 13 | return result |