Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3194 Weergaven

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
Annuleer
Auteur Beste antwoord

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
Annuleer

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?

Auteur

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.

Gerelateerde posts Antwoorden Weergaven Activiteit
3
sep. 24
1216
1
mrt. 24
2150
1
mei 23
5873
1
sep. 19
3342
0
dec. 18
2592