如何创建默认的单选按钮网站,我想在我的网站上早上在单选按钮中设置默认值。
<template id="fal_shift_opt" inherit_id="website_sale.payment" customize_show="True" name="Shift Option">
<xpath expr="//div[@id='delivery_carrier']" position="before">
<div class="row" id="shift_option">
<div class="col-lg-7 col-sm-8">
<h4>Choose your shift delivery</h4>
<ul class="list-unstyled">
<li>
<label>
<input value="morning" type="radio" name="shift2"
t-att-checked="order.shift2 == 'morning' and 'checked' or False"
/>
<span>Morning</span>
</label>
</li>
<li>
<label>
<input value="afternoon" type="radio" name="shift2"
t-att-checked="order.shift2 == 'afternoon' and 'checked' or False"
/>
<span>Afternoon</span>
</label>
</li>
</ul>
</div>
</div>
</xpath>
</template>
是谁帮忙?
答案 0 :(得分:1)
将t-att-checked更改为t-attf-checked
一个例子:
t-attf-checked =&#34;#{user_name ==&#39;管理员&#39;或者错误}&#34;