Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3160 Widoki

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?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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>
Awatar
Odrzuć

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?

Autor

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.

Powiązane posty Odpowiedzi Widoki Czynność
3
wrz 24
1160
1
mar 24
2090
1
maj 23
5821
1
wrz 19
3293
0
gru 18
2512