增加刀具管理权限控制,刀具组权限控制,隐藏工单上原生按钮,修复只读权限后修改记录无权限问题等
This commit is contained in:
@@ -287,11 +287,11 @@ class ShelfLocation(models.Model):
|
||||
"""
|
||||
for record in self:
|
||||
if record.product_sn_id:
|
||||
record.product_id = record.product_sn_id.product_id
|
||||
record.location_status = '占用'
|
||||
record.sudo().product_id = record.product_sn_id.product_id
|
||||
record.sudo().location_status = '占用'
|
||||
else:
|
||||
record.product_id = False
|
||||
record.location_status = '空闲'
|
||||
record.sudo().product_id = False
|
||||
record.sudo().location_status = '空闲'
|
||||
|
||||
@api.depends('location_type')
|
||||
def _compute_hide_what(self):
|
||||
@@ -300,12 +300,12 @@ class ShelfLocation(models.Model):
|
||||
:return:
|
||||
"""
|
||||
for record in self:
|
||||
record.hide_shelf = False
|
||||
record.hide_location = False
|
||||
record.sudo().hide_shelf = False
|
||||
record.sudo().hide_location = False
|
||||
if record.location_type and record.location_type == '货架':
|
||||
record.hide_shelf = True
|
||||
record.sudo().hide_shelf = True
|
||||
elif record.location_type and record.location_type == '货位':
|
||||
record.hide_location = True
|
||||
record.sudo().hide_location = True
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user