Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:DLUT-SIE/ERP into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeeco committed Jan 18, 2018
2 parents bd6bf86 + 27ee116 commit 962cd53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 13 additions & 6 deletions Process/models/quota.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.db import models, transaction
from django.db import models
from django.contrib.auth.models import User

from Process import (
Expand Down Expand Up @@ -83,7 +83,8 @@ def createProcurementMaterial(self):
procurement_material.category = \
item.process_material.material.category
procurement_material.count = item.process_material.count
procurement_material.weight = item.process_material.weight
procurement_material.weight = \
item.process_material.piece_weight or 0
procurement_material_list.append(procurement_material)
else:
for sub_order in work_order.subworkorder_set.all():
Expand All @@ -92,10 +93,16 @@ def createProcurementMaterial(self):
procurement_material = ProcurementMaterial()
procurement_material.sub_order = sub_order
procurement_material.inventory_type = self.category
procurement_material.material_number = item.material.uid
procurement_material.category = item.material.category
procurement_material.count = item.count
procurement_material.weight = item.weight
if self.category != QUOTA_LIST_CATEGORY_AUXILIARY:
procurement_material.material_number = \
item.material.uid
procurement_material.category = item.material.category
if self.category == QUOTA_LIST_CATEGORY_PRINCIPAL:
procurement_material.count = item.count
procurement_material.weight = item.weight
else:
procurement_material.weight = item.quota or 0
procurement_material.count = 0
procurement_material_list.append(procurement_material)
ProcurementMaterial.objects.bulk_create(procurement_material_list)

Expand Down
6 changes: 3 additions & 3 deletions Production/serializers/man_hour_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


class ManHourMessageSerializer(serializers.ModelSerializer):
sub_order = serializers.CharField(source='sub_material.sub_order',
read_only=True)
sub_order_uid = serializers.CharField(source='sub_material.sub_order.uid',
read_only=True)
ticket_number = serializers.CharField(
source='sub_material.material.ticket_number', read_only=True)
step = serializers.CharField(source='process_step.step',
Expand All @@ -23,7 +23,7 @@ class ManHourMessageSerializer(serializers.ModelSerializer):

class Meta:
model = ProcessDetail
fields = ('id', 'sub_order', 'ticket_number', 'work_group_name',
fields = ('id', 'sub_order_uid', 'ticket_number', 'work_group_name',
'step', 'man_hours', 'writer', 'quota_clerk',
'actual_finish_dt')
read_only_fields = ('id', 'work_group_name', 'actual_finish_dt')

0 comments on commit 962cd53

Please sign in to comment.