feat: 一次填写的也mlogb_from
This commit is contained in:
parent
8f079c9d5d
commit
443a818aec
|
@ -353,6 +353,7 @@ class MlogSerializer(CustomModelSerializer):
|
|||
wm_in = instance.wm_in
|
||||
if wm_in:
|
||||
batch_in = wm_in.batch
|
||||
mlogbin = None
|
||||
if instance.material_in: # 如果有消耗
|
||||
add_dict = {
|
||||
'mlog': instance, 'batch': batch_in, 'wm_in': wm_in,
|
||||
|
@ -417,6 +418,8 @@ class MlogSerializer(CustomModelSerializer):
|
|||
ddict = {}
|
||||
if wm_in:
|
||||
ddict = {"batch_ofrom": wm_in.batch_ofrom, "material_ofrom": wm_in.material_ofrom}
|
||||
if mlogbin:
|
||||
ddict["mlogb_from"] = mlogbin
|
||||
mlogb, _ = Mlogb.objects.get_or_create(**add_dict_2, defaults=ddict)
|
||||
if need_mdfect:
|
||||
mlogb_defect_objects = [
|
||||
|
|
Loading…
Reference in New Issue