跳至内容
菜单
此问题已终结
1 回复
3193 查看

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?

形象
丢弃
编写者 最佳答案

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>
形象
丢弃

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?

编写者

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.

相关帖文 回复 查看 活动
3
9月 24
1216
1
3月 24
2150
1
5月 23
5873
1
9月 19
3341
0
12月 18
2592