Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
6244 Weergaven

Hi,

    I am new in odoo and currently, I am developing a module that adds a field on the website. May I know how to add a selection field in website payment page.

Avatar
Annuleer
Beste antwoord

Hi,

You have to inherit the payment template of website payment page(website_sale.payment) for adding a new field to it.

You can refer the following example for adding a selection field in payment page of website

<template id="website_payment_inherit" inherit_id="website_sale.payment">
<xpath expr="//div[@id='payment_method']" position="before">
<t t-set="field_name_val"
t-value="request.env['model.name'].sudo().
search([])"/>
<select class='detail needsclick' name='field_name'>
<option value=''>None</option>
<t t-foreach='field_name_val' t-as='val'>
<option t-att-value='val.id'>
<t t-esc='val.name'/>
</option>
</t>
</select>
</xpath>
</template>

To know more about Odoo website-controllers visit the following blog

https://www.cybrosys.com/blog/web-controllers-in-odoo

If you new to Odoo development then you can refer the below resources for the future development purpose

https://www.youtube.com/playlist?list=PLeJtXzTubzj-tbQ94heWeQFB0twGd0vvN

Regards

Avatar
Annuleer
Auteur

Thank you

Beste antwoord

@aghezzaf mohamed did you know how to do that ?

Avatar
Annuleer