odoo 某个字段权限设置

<field name="qty_done" groups="stock.group_stock_manager" attrs="{'readonly': [('location_id', '=', 8)]}"/>
<button name="split_lot" string="Lot Split" type="object" icon="fa-list" groups="stock.group_production_lot" attrs="{'invisible': ['|', ('lots_visible', '=', False), ('state', 'not in', ['confirmed', 'assigned', 'waiting', 'partially_available','done'])]}"/>
<button name="show_details" string="Modify" type="object" icon="fa-pencil" groups="stock.group_stock_multi_locations" states="confirmed,assigned,waiting,partially_available"/>
<field name="qty_done" groups="purchase.group_purchase_user"/>

 仓库采购各分配一个qty字段,分别进行编辑 和只可见的限制

1、 对qty_done字段进行控制,采购入库单 仓库只可见,然而采购不是仓库管理员

2、对qty_done字段进行控制,是采购单时,仓库可见能编辑,但是内部调拨单是可以编辑的。

猜你喜欢

转载自www.cnblogs.com/tank-/p/9084477.html