对“还原库存调整按钮”做权限控制
This commit is contained in:
@@ -424,6 +424,14 @@ class Sf_stock_move_line(models.Model):
|
||||
# lot_qr_code = fields.Binary(string='二维码', compute='_compute_lot_qr_code', store=True)
|
||||
lot_qr_code = fields.Binary(string='二维码', compute='_compute_lot_qr_code', store=True)
|
||||
|
||||
def action_revert_inventory(self):
|
||||
# 检查用户是否有执行操作的权限
|
||||
if not self.env.user.has_group('sf_warehouse.group_sf_stock_user'):
|
||||
raise UserError(_('You do not have the necessary permissions to perform this action.'))
|
||||
|
||||
# 如果用户有权限,调用父类方法
|
||||
return super(CustomStockMoveLine, self).action_revert_inventory()
|
||||
|
||||
@api.depends('lot_name')
|
||||
def _compute_lot_qr_code(self):
|
||||
for record in self:
|
||||
|
||||
Reference in New Issue
Block a user