forked from erp-dev/erp
fix: business cancel service merged
This commit is contained in:
@@ -171,6 +171,7 @@ class PrintingJobByCustomerAPITest(TestCase):
|
||||
customer=self.customer,
|
||||
fabric='棉',
|
||||
width='150cm',
|
||||
external_order_id='KD20410611',
|
||||
)
|
||||
self.printing_order_other = printing_models.PrintingOrder.objects.create(
|
||||
customer=self.customer,
|
||||
@@ -251,6 +252,7 @@ class PrintingJobByCustomerAPITest(TestCase):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertEqual(len(resp.data), 1)
|
||||
self.assertEqual(resp.data[0]['id'], self.job_in_range.id)
|
||||
self.assertEqual(resp.data[0]['external_order_id'], 'KD20410611')
|
||||
self.assertEqual(resp.data[0]['billed_quantity'], '20.00')
|
||||
|
||||
def test_filter_by_printing_order(self):
|
||||
|
||||
@@ -49,6 +49,7 @@ def _serialize_plate_image_first(raw_value, request):
|
||||
class PrintingJobV2Serializer(serializers.ModelSerializer):
|
||||
"""v2 独立的印染任务序列化器,包含开单数量"""
|
||||
|
||||
external_order_id = serializers.CharField(source='printing_order.external_order_id', read_only=True)
|
||||
billed_quantity = serializers.DecimalField(max_digits=18, decimal_places=2, read_only=True)
|
||||
business_object_id = serializers.SerializerMethodField()
|
||||
width = serializers.SerializerMethodField()
|
||||
@@ -61,6 +62,7 @@ class PrintingJobV2Serializer(serializers.ModelSerializer):
|
||||
'id',
|
||||
'original_id',
|
||||
'printing_order',
|
||||
'external_order_id',
|
||||
'product',
|
||||
'work_state',
|
||||
'quantity',
|
||||
@@ -75,7 +77,7 @@ class PrintingJobV2Serializer(serializers.ModelSerializer):
|
||||
'updated_at',
|
||||
'billed_quantity',
|
||||
]
|
||||
read_only_fields = ['id', 'created_at', 'updated_at', 'billed_quantity']
|
||||
read_only_fields = ['id', 'created_at', 'updated_at', 'external_order_id', 'billed_quantity']
|
||||
|
||||
def get_business_object_id(self, obj):
|
||||
return obj.business_object_id
|
||||
|
||||
Reference in New Issue
Block a user