如何在odoo10中为股票用户隐藏表单和树形图/序列号的创建和编辑按钮

时间:2018-09-21 12:27:48

标签: odoo-10

我只想为管理员和库存经理创建和编辑批号/序列号,而不能为用户创建和编辑。

<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>

但是它不起作用!

1 个答案:

答案 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>