【问题标题】:Odoo 10: Input field next to a boolen fieldOdoo 10:布尔字段旁边的输入字段
【发布时间】:2018-11-28 13:53:41
【问题描述】:

我想在笔记本中创建如下视图,其中输入字段位于布尔字段旁边:

我尝试了下面的代码,但没有成功:

<notebook colspan="4">
    <page name="HR Team" string="HR Team" >
         <group string="All Employees">
                 <table>
                     <td><field name="onBoardingMail" attrs="{'readonly':True}" /></td>
                      <td><field name="onBoardingMail_comment"  /></td> 
                </table>
        </group>
    </page>
</notebook>

实现这一观点的正确方法是什么?

【问题讨论】:

    标签: xml input view boolean odoo


    【解决方案1】:

    下面的视图应该可以工作,当复选框为False时,输入字段可以是只读的。

    <notebook colspan="4">
        <page name="HR Team" string="HR Team">
            <group string="All Employees">
                <label string="onBoarding Email" for="onBoardingMail_comment" class="oe_inline"/>
                <div>
                    <field name="onBoardingMail" nolabel="1" class="oe_inline"/>
                    <field name="onBoardingMail_comment" placeholder="This is a Comment" nolabel="1" class="oe_inline" attrs="{'readonly':[('onBoardingMail','=',False)]}"/>
                </div>
            </group>
        </page>
    </notebook>
    

    启用复选框时:

    当复选框被禁用时:

    【讨论】:

      猜你喜欢
      • 2022-12-26
      • 2019-02-24
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-03
      相关资源
      最近更新 更多