我只想为管理员和库存经理创建和编辑批号/序列号,而不能为用户创建和编辑。
<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>
但是它不起作用!
答案 0 :(得分:0)
尝试:
<attribute name ="groups">!stock.group_stock_user,stock.group_stock_manager</attribute>
或仅将组设置为仅stock.group_stock_manager
<attribute name ="groups">stock.group_stock_manager</attribute>