mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Remove custom creation code for SupplierPart serializer
This commit is contained in:
		@@ -231,25 +231,6 @@ class SupplierPartSerializer(InvenTreeModelSerializer):
 | 
				
			|||||||
            'supplier_detail',
 | 
					            'supplier_detail',
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def create(self, validated_data):
 | 
					 | 
				
			||||||
        """ Extract manufacturer data and process ManufacturerPart """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Create SupplierPart
 | 
					 | 
				
			||||||
        supplier_part = super().create(validated_data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Get ManufacturerPart raw data (unvalidated)
 | 
					 | 
				
			||||||
        manufacturer_id = self.initial_data.get('manufacturer', None)
 | 
					 | 
				
			||||||
        MPN = self.initial_data.get('MPN', None)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if manufacturer_id and MPN:
 | 
					 | 
				
			||||||
            kwargs = {
 | 
					 | 
				
			||||||
                'manufacturer': manufacturer_id,
 | 
					 | 
				
			||||||
                'MPN': MPN,
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            supplier_part.save(**kwargs)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return supplier_part
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SupplierPriceBreakSerializer(InvenTreeModelSerializer):
 | 
					class SupplierPriceBreakSerializer(InvenTreeModelSerializer):
 | 
				
			||||||
    """ Serializer for SupplierPriceBreak object """
 | 
					    """ Serializer for SupplierPriceBreak object """
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user