feat: is_hidden的物料也需要进行车间库存管理
This commit is contained in:
parent
1ef6826776
commit
95f67b6543
|
|
@ -149,7 +149,7 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
|
|||
belong_dept = mlog.mgroup.belong_dept
|
||||
material_out = mlog.material_out
|
||||
material_in = mlog.material_in
|
||||
if material_in and material_in.is_hidden is False: # 需要进行车间库存管理
|
||||
if material_in: # 需要进行车间库存管理
|
||||
# 需要判断领用数是否合理
|
||||
material_has_qs = WMaterial.objects.filter(
|
||||
batch=mlog.batch, material=material_in, belong_dept=belong_dept)
|
||||
|
|
@ -165,7 +165,7 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
|
|||
else:
|
||||
material_has.count = material_has.count - mlog.count_use
|
||||
material_has.save()
|
||||
if material_out and material_out.is_hidden is False: # 需要入车间库存
|
||||
if material_out: # 需要入车间库存
|
||||
# 有多个产物的情况
|
||||
if material_out.brothers and Mlogb.objects.filter(mlog=mlog).exists():
|
||||
for item in Mlogb.objects.filter(mlog=mlog):
|
||||
|
|
|
|||
Loading…
Reference in New Issue