oca-ocb-sale/odoo-bringout-oca-ocb-website_sale_stock/website_sale_stock/controllers/website_sale.py
Ernad Husremovic 73afc09215 19.0 vanilla
2026-03-09 09:32:12 +01:00

14 lines
597 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, **kwargs):
values = super()._prepare_product_values(product, category, **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