Accept Merge Request #780: (feature/制造代码优化 -> develop)

Merge Request: 增加刀具管理权限控制,刀具组权限控制,隐藏工单上原生按钮,修复只读权限后修改记录无权限问题等

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/780?initial=true
This commit is contained in:
马广威
2024-01-22 15:40:23 +08:00
committed by Coding
10 changed files with 125 additions and 93 deletions

View File

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