İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
257 Görünümler

When someones sees an out of stock product, there is the option to fill out an email field to get notified of re-stock. However no matter what email format is used, they always get "Invalid Email" message displayed. 

I see nothing wrong with the related view "product_wishlist" 


     </div>

                    <div id="stock_notification_form" class="d-none">

                        <div class="input-group">

                            <input id="stock_notification_input" class="form-control" name="email" type="text" placeholder="votremail@gmail.com" t-att-value="request.env.user.partner_id.email or request.session.get('stock_notification_email', '')"/>

                            <div id="wishlist_stock_notification_form_submit_button" class="btn btn-secondary">

                                <i class="fa fa-paper-plane"/>

                            </div>

                            <div id="stock_notification_input_incorrect" class="btn d-none">

                                <i class="fa fa-times text-danger"/>

                                Invalid email

                            </div>

                        </div>

                    </div>

                    <div id="stock_notification_success_message" class="text-muted" t-att-class="'text-muted' if has_stock_notification else 'd-none'">

                        <i class="fa fa-bell"/>

                        We'll notify you once the product is back in stock.

                    </div>





I'm on a custom OVH mail server. Is it related ? 

Many thanks

Avatar
Vazgeç
En İyi Yanıt

Hi,

That error is not related to your OVH mail server. The “Invalid Email” message comes from the JS validation in the website_sale_stock module. Odoo checks the format of the email against a regex before saving it in the stock.notification model. If the regex fails, it shows “Invalid email” without even trying to send.

A few things to check:

  1. Make sure the input type is type="email" instead of type="text" (this helps HTML5 validation too).
  2. Verify that the regex in website_sale_stock/static/src/js/stock_notification.js is not being overridden by a custom module/theme — sometimes themes use a stricter regex that blocks valid emails.
  3. Test with simple addresses like test@gmail.com. If those fail, it’s definitely a frontend validation issue.
  4. If you want to bypass this, you can patch the JS regex or loosen it to accept a wider range of addresses.

So, short answer: this is a frontend validation problem, not your mail server. Once the email passes validation, Odoo will store it, and the notification will be sent later by email (using your OVH server config).

Hope this helps.

Avatar
Vazgeç