如何隐藏 odoo10 中股票用户的 lot/serial 编号的表单和树视图的创建和编辑按钮
how to hide create and edit button of form and tree view of lot/serial number for stock user in odoo10
我只想为管理员和库存经理创建和编辑 lot/serial 号码,而不是为用户。
<record id = "view_stock_production_lot_tree_inherit" model="ir.ui.view">
<field name ="name">Stock Production Lot Inherit</field>
<field name ="model">stock.production.lot</field>
<field name ="inherit_id" ref ="stock.view_production_lot_tree"/>
<field name ="groups_id" eval = "[(4,ref('stock.group_stock_user'))]"/>
<field name ="arch" type = "xml">
<xpath expr ="//tree" position = "attributes">
<attribute name ="options">{'no_create_edit': True, 'no_create':True}</attribute>
<attribute name ="groups">stock.group_stock_user</attribute>
</xpath>
</field>
</record>
但它不起作用!!
试试:
<attribute name ="groups">!stock.group_stock_user,stock.group_stock_manager</attribute>
或将群组专门设置为仅 stock.group_stock_manager
<attribute name ="groups">stock.group_stock_manager</attribute>
我只想为管理员和库存经理创建和编辑 lot/serial 号码,而不是为用户。
<record id = "view_stock_production_lot_tree_inherit" model="ir.ui.view">
<field name ="name">Stock Production Lot Inherit</field>
<field name ="model">stock.production.lot</field>
<field name ="inherit_id" ref ="stock.view_production_lot_tree"/>
<field name ="groups_id" eval = "[(4,ref('stock.group_stock_user'))]"/>
<field name ="arch" type = "xml">
<xpath expr ="//tree" position = "attributes">
<attribute name ="options">{'no_create_edit': True, 'no_create':True}</attribute>
<attribute name ="groups">stock.group_stock_user</attribute>
</xpath>
</field>
</record>
但它不起作用!!
试试:
<attribute name ="groups">!stock.group_stock_user,stock.group_stock_manager</attribute>
或将群组专门设置为仅 stock.group_stock_manager
<attribute name ="groups">stock.group_stock_manager</attribute>