feat: mlogbin create时处理qct
This commit is contained in:
parent
c5bcfb4e53
commit
31e8b92d29
|
@ -701,7 +701,7 @@ class MlogbOutUpdateSerializer(CustomModelSerializer):
|
||||||
model = Mlogb
|
model = Mlogb
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
read_only_fields = EXCLUDE_FIELDS_BASE + ['mlog', 'mtask', 'wm_in', 'material_in', 'material_out',
|
read_only_fields = EXCLUDE_FIELDS_BASE + ['mlog', 'mtask', 'wm_in', 'material_in', 'material_out',
|
||||||
'count_use', 'count_break', 'count_pn_jgqbl', 'mlogbdefect']
|
'count_use', 'count_break', 'count_pn_jgqbl', 'mlogbdefect', "qct"]
|
||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
material_out:Material = validated_data["material_out"]
|
material_out:Material = validated_data["material_out"]
|
||||||
|
|
|
@ -595,7 +595,7 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust
|
||||||
if is_fix and mgroup.process.type == Process.PRO_PROD:
|
if is_fix and mgroup.process.type == Process.PRO_PROD:
|
||||||
# 如果是生产返修,则忽略质检
|
# 如果是生产返修,则忽略质检
|
||||||
pass
|
pass
|
||||||
elif mlogbout.qct:
|
elif mlogbout.qct is None:
|
||||||
try:
|
try:
|
||||||
qctmat = QctMat.objects.get(material=material_out, qct__is_deleted=False, qct__tags__contains="process").order_by("-create_time")
|
qctmat = QctMat.objects.get(material=material_out, qct__is_deleted=False, qct__tags__contains="process").order_by("-create_time")
|
||||||
except QctMat.DoesNotExist:
|
except QctMat.DoesNotExist:
|
||||||
|
|
Loading…
Reference in New Issue