mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Bug fix for recent SupplierPart API annotation (#3336)
This commit is contained in:
		| @@ -284,7 +284,7 @@ class SupplierPartSerializer(InvenTreeModelSerializer): | ||||
|         """ | ||||
|  | ||||
|         queryset = queryset.annotate( | ||||
|             in_stock=part.filters.annotate_total_stock(reference='part__') | ||||
|             in_stock=part.filters.annotate_total_stock() | ||||
|         ) | ||||
|  | ||||
|         return queryset | ||||
|   | ||||
| @@ -0,0 +1,20 @@ | ||||
| # Generated by Django 3.2.14 on 2022-07-15 07:49 | ||||
|  | ||||
| from django.db import migrations, models | ||||
| import django.db.models.deletion | ||||
|  | ||||
|  | ||||
| class Migration(migrations.Migration): | ||||
|  | ||||
|     dependencies = [ | ||||
|         ('company', '0046_alter_company_image'), | ||||
|         ('stock', '0077_alter_stockitem_notes'), | ||||
|     ] | ||||
|  | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='stockitem', | ||||
|             name='supplier_part', | ||||
|             field=models.ForeignKey(blank=True, help_text='Select a matching supplier part for this stock item', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_items', to='company.supplierpart', verbose_name='Supplier Part'), | ||||
|         ), | ||||
|     ] | ||||
| @@ -598,7 +598,8 @@ class StockItem(MetadataMixin, MPTTModel): | ||||
|     supplier_part = models.ForeignKey( | ||||
|         'company.SupplierPart', blank=True, null=True, on_delete=models.SET_NULL, | ||||
|         verbose_name=_('Supplier Part'), | ||||
|         help_text=_('Select a matching supplier part for this stock item') | ||||
|         help_text=_('Select a matching supplier part for this stock item'), | ||||
|         related_name='stock_items', | ||||
|     ) | ||||
|  | ||||
|     # Note: When a StockLocation is deleted, stock items are updated via a signal | ||||
|   | ||||
		Reference in New Issue
	
	Block a user