Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3227 Visualizzazioni

When user makes an order via website and adds his delivery address (different than the invoice address) the address generates without an email address.

Because of that when the delivery is confirmed a notification email can not be send and there is an error about empty email address.

How do I correct this? Do I need to manually add this email field inside the form?

Avatar
Abbandona
Autore Risposta migliore

I've had to fix it by myself. Here is the snippet that does the job:


        <template id="custom_address" inherit_id="website_sale.address" name="Website Sale Custom Address">
            <xpath expr="//div[@id='div_email']/.." position="replace">
                <div t-attf-class="form-group #{error.get('email') and 'o_has_error' or ''} col-lg-6" id="div_email">
                    <label class="col-form-label" for="email">Email</label>
                    <input type="email" name="email" t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}" t-att-value="'email' in checkout and checkout['email']" />
                </div>
            </xpath>

            <xpath expr="//input[@name='field_required']" position="replace">
                <input type="hidden" name="field_required" t-att-value="'phone,name,email'" />
            </xpath>

        </template>
Avatar
Abbandona

Hi Marcus. I'm having a similar trouble with the third party shipping module I use for a V11 website. What version is the above snippet for, and what file did you insert it in?

Autore

I used this snipped in version 13. It may run on other versions if the address form looks the same.

I put it in my custom module. This snippet inherits and modifies view with id "address" present in module "website_sale". You need to find if you have this view in your Odoo and if not - what other view is responsible for displaying the address form to a user.

Ok, thanks for replying. I'll give it a try.

Post correlati Risposte Visualizzazioni Attività
3
set 24
1257
1
mar 24
2191
1
mag 23
5909
1
set 19
3392
0
dic 18
2619