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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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 ?
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký