fix: do_in bug

This commit is contained in:
caoqianming 2024-11-14 11:54:55 +08:00
parent a00f533752
commit 6006d42f9d
1 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ def do_in(item: MIOItem):
raise ParseError(f'{str(xmaterial)}-{xbatch}车间物料不属于同一车间')
# 增加mb
if not is_zhj:
mb, _ = MaterialBatch.objects.get(
mb, _ = MaterialBatch.objects.get_or_create(
material=xmaterial,
warehouse=item.warehouse,
batch=xbatch,
@ -163,7 +163,7 @@ def do_in(item: MIOItem):
if is_zhj: # 组合件单独处理
mb, is_created = MaterialBatch.objects.get(
mb, is_created = MaterialBatch.objects.get_or_create(
material=item.material,
warehouse=item.warehouse,
batch=item.batch,