2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Merge pull request #1705 from SchrodingersGat/part-validation

API Validation fixes
This commit is contained in:
Oliver
2021-06-22 13:39:05 +10:00
committed by GitHub
12 changed files with 311 additions and 41 deletions

View File

@ -199,7 +199,8 @@ def update_history(apps, schema_editor):
update_count += 1
print(f"\n==========================\nUpdated {update_count} StockItemHistory entries")
if update_count > 0:
print(f"\n==========================\nUpdated {update_count} StockItemHistory entries")
def reverse_update(apps, schema_editor):

View File

@ -26,7 +26,8 @@ def extract_purchase_price(apps, schema_editor):
# Find all the StockItem objects without a purchase_price which point to a PurchaseOrder
items = StockItem.objects.filter(purchase_price=None).exclude(purchase_order=None)
print(f"Found {items.count()} stock items with missing purchase price information")
if items.count() > 0:
print(f"Found {items.count()} stock items with missing purchase price information")
update_count = 0
@ -56,7 +57,8 @@ def extract_purchase_price(apps, schema_editor):
break
print(f"Updated pricing for {update_count} stock items")
if update_count > 0:
print(f"Updated pricing for {update_count} stock items")
def reverse_operation(apps, schema_editor):
"""