mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	API fixes related to ManufacturerPart
This commit is contained in:
		@@ -131,7 +131,7 @@ class ManufacturerPartList(generics.ListCreateAPIView):
 | 
				
			|||||||
        params = self.request.query_params
 | 
					        params = self.request.query_params
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Filter by manufacturer
 | 
					        # Filter by manufacturer
 | 
				
			||||||
        manufacturer = params.get('company', None)
 | 
					        manufacturer = params.get('manufacturer', None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if manufacturer is not None:
 | 
					        if manufacturer is not None:
 | 
				
			||||||
            queryset = queryset.filter(manufacturer=manufacturer)
 | 
					            queryset = queryset.filter(manufacturer=manufacturer)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -192,10 +192,11 @@ class SupplierPartSerializer(InvenTreeModelSerializer):
 | 
				
			|||||||
        manufacturer_id = self.initial_data.get('manufacturer', None)
 | 
					        manufacturer_id = self.initial_data.get('manufacturer', None)
 | 
				
			||||||
        MPN = self.initial_data.get('MPN', None)
 | 
					        MPN = self.initial_data.get('MPN', None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if manufacturer_id or MPN:
 | 
					        if manufacturer_id and MPN:
 | 
				
			||||||
            kwargs = {'manufacturer': manufacturer_id,
 | 
					            kwargs = {
 | 
				
			||||||
                      'MPN': MPN,
 | 
					                'manufacturer': manufacturer_id,
 | 
				
			||||||
                      }
 | 
					                'MPN': MPN,
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            supplier_part.save(**kwargs)
 | 
					            supplier_part.save(**kwargs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return supplier_part
 | 
					        return supplier_part
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user