コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
6252 ビュー

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.

アバター
破棄
最善の回答

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 ?

アバター
破棄