施程浩 发表于 2018-6-25 16:27:55

实现隐藏方法

本帖最后由 施程浩 于 2018-6-25 16:30 编辑

* 直接隐藏
    <group name="owner" position="attributes">
            <attribute name="invisible">1</attribute>
    </group>

* 满足某些条件的隐藏
         <xpath expr="//field[@name='parent_id']" position='attributes'>
             <attribute name="attrs">{'invisible': [('passenger','=', True)]}</attribute>
         </xpath>
    <group col="4" string='旅客信息' attrs="{'invisible': [('supplier','=', True)]}"></group>

* 通过组来隐藏
    <xpath expr="//field[@name='type']" position="attributes">
                <attribute name="groups">base.group_no_one</attribute>
         </xpath>

* 菜单的隐藏
    <record model="ir.ui.menu" id="crm.menu_crm_opportunities">
            <field eval="[(6,0, )]" name="groups_id"/>
    </record>







smlqf1 发表于 2018-9-20 11:31:22

非常感谢您!











英語手抄報   http://www.gfgfgf.com.tw/zyts/zyzl/ 2018年09月20日 旅遊排行
中醫導航    唯美詩句 http://www.gfgfgf.com.tw/zybj/nvxbj/非主流髮型         http://www.gfgfgf.com.tw/zyts/zygy/簽名小語大全
页: [1]
查看完整版本: 实现隐藏方法