Odoo中文网|Odoo实施培训

标题: 实现隐藏方法 [打印本页]

作者: 施程浩    时间: 2018-6-25 16:27
标题: 实现隐藏方法
本帖最后由 施程浩 于 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, [ref('base.group_no_one'),])]" name="groups_id"/>
    </record>








作者: smlqf1    时间: 2018-9-20 11:31
非常感谢您!











英語手抄報   http://www.gfgfgf.com.tw/zyts/zyzl/   2018年09月20日 旅遊排行
中醫導航    唯美詩句 http://www.gfgfgf.com.tw/zybj/nvxbj/  非主流髮型         http://www.gfgfgf.com.tw/zyts/zygy/  簽名小語大全




欢迎光临 Odoo中文网|Odoo实施培训 (http://www.chinaodoo.net/) Powered by Discuz! X3.2