feat: 自动生成物料时延续cate
This commit is contained in:
parent
1781dba630
commit
3f32390fb2
|
@ -186,6 +186,7 @@ class RouteSerializer(CustomModelSerializer):
|
||||||
material_out.name = material.name
|
material_out.name = material.name
|
||||||
material_out.model = material.model
|
material_out.model = material.model
|
||||||
material_out.specification = material.specification
|
material_out.specification = material.specification
|
||||||
|
material_out.cate = material.cate
|
||||||
material_out.save()
|
material_out.save()
|
||||||
instance.material_out = material_out
|
instance.material_out = material_out
|
||||||
instance.save()
|
instance.save()
|
||||||
|
@ -195,6 +196,7 @@ class RouteSerializer(CustomModelSerializer):
|
||||||
material_out.is_deleted = False
|
material_out.is_deleted = False
|
||||||
if material_out.parent is None:
|
if material_out.parent is None:
|
||||||
material_out.parent = material
|
material_out.parent = material
|
||||||
|
material_out.cate = material.cate
|
||||||
material_out.save()
|
material_out.save()
|
||||||
instance.material_out = material_out
|
instance.material_out = material_out
|
||||||
instance.save()
|
instance.save()
|
||||||
|
@ -205,6 +207,7 @@ class RouteSerializer(CustomModelSerializer):
|
||||||
'specification': material.specification,
|
'specification': material.specification,
|
||||||
'model': material.model,
|
'model': material.model,
|
||||||
'type': Material.MA_TYPE_HALFGOOD,
|
'type': Material.MA_TYPE_HALFGOOD,
|
||||||
|
'cate': Material.cate,
|
||||||
'create_by': self.request.user,
|
'create_by': self.request.user,
|
||||||
'update_by': self.request.user,
|
'update_by': self.request.user,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue