Odoo18-Base/addons/website_sale_stock/controllers/website_sale.py
2025-01-06 10:57:38 +07:00

15 lines
619 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.http import request
from odoo.addons.website_sale.controllers import main
class WebsiteSale(main.WebsiteSale):
def _prepare_product_values(self, product, category='', search='', **kwargs):
values = super()._prepare_product_values(product, category, search, **kwargs)
# We need the user mail to prefill the back of stock notification, so we put it in the value that will be sent
values['user_email'] = request.env.user.email or request.session.get('stock_notification_email', '')
return values