python - 如何创建默认单选按钮网站

标签 python odoo

如何创建默认单选按钮网站,我想在我的网站早上在单选按钮中设置默认值。

<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>

同一个人帮忙吗?

最佳答案

将 t-att-checked 更改为 t-attf-checked

示例:

t-attf-checked="#{user_name == '管理员'或False}"

关于python - 如何创建默认单选按钮网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47407926/

相关文章:

python - 将 <h1> 标题添加到继承的表单 - Odoo v9 社区

database - 在odoo中按登录用户选择数据库

python - 用 pandas reshape 数据框

python - 在 python/django 应用程序中查找阻塞函数

python - random.seed(seed) 是否在多个进程中生成相同的序列?

python - 事件时对不同字段进行求和 - Odoo v8

python - 如何从位于 Odoo 11 表单操作下拉列表中的按钮发送电子邮件?

python - 在 mllib kmeans pyspark 中获取集群标签

python - numpy:根据多个条件将值设置为零

odoo - 缩进使用条件