fix: do_in保证production_dept赋值
This commit is contained in:
parent
1aad0bc481
commit
044b489388
|
@ -185,6 +185,8 @@ def do_in(item: MIOItem):
|
|||
"production_dept": production_dept
|
||||
}
|
||||
)
|
||||
if mb.production_dept is None:
|
||||
mb.production_dept = production_dept
|
||||
mb.count = mb.count + xcount
|
||||
mb.save()
|
||||
|
||||
|
@ -204,10 +206,12 @@ def do_in(item: MIOItem):
|
|||
batch=item.batch,
|
||||
defaults={"count": 0, "production_dept": production_dept}
|
||||
)
|
||||
mb.count = mb.count + item.count
|
||||
mb.save()
|
||||
if not is_created:
|
||||
raise ParseError("该批次组合件已存在")
|
||||
if mb.production_dept is None:
|
||||
mb.production_dept = production_dept
|
||||
mb.count = mb.count + item.count
|
||||
mb.save()
|
||||
for mia in mias:
|
||||
MaterialBatchA.objects.create(mb=mb, material=mia.material, batch=mia.batch, rate=mia.rate)
|
||||
|
||||
|
|
Loading…
Reference in New Issue