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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
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
Thank you
@aghezzaf mohamed did you know how to do that ?
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden