feat: 生产入库update_mb时记录production_dept
This commit is contained in:
parent
aaa5545c30
commit
462a25bb9a
|
@ -48,6 +48,7 @@ class InmService:
|
||||||
in = 1
|
in = 1
|
||||||
out = -1
|
out = -1
|
||||||
"""
|
"""
|
||||||
|
belong_dept = instance.belong_dept
|
||||||
mioitems = MIOItem.objects.filter(mio=instance)
|
mioitems = MIOItem.objects.filter(mio=instance)
|
||||||
if not mioitems.exists():
|
if not mioitems.exists():
|
||||||
raise ParseError('未填写物料明细')
|
raise ParseError('未填写物料明细')
|
||||||
|
@ -60,6 +61,12 @@ class InmService:
|
||||||
mb.count = mb.count + i.count
|
mb.count = mb.count + i.count
|
||||||
# if mb.expiration_date is None:
|
# if mb.expiration_date is None:
|
||||||
# mb.expiration_date = i.expiration_date
|
# mb.expiration_date = i.expiration_date
|
||||||
|
if instance.type == MIO.MIO_TYPE_DO_IN: # 生产入库需要记录production_dept字段
|
||||||
|
if mb.production_dept is None or mb.production_dept == belong_dept:
|
||||||
|
mb.production_dept = belong_dept
|
||||||
|
mb.save()
|
||||||
|
else:
|
||||||
|
raise ParseError('同种物料不同生产车间应该有不同批次号!')
|
||||||
mb.save()
|
mb.save()
|
||||||
mias = MIOItemA.objects.filter(mioitem=i)
|
mias = MIOItemA.objects.filter(mioitem=i)
|
||||||
if mias.exists(): # 组合件入库
|
if mias.exists(): # 组合件入库
|
||||||
|
|
Loading…
Reference in New Issue