mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Fix for potential MissingKey error (#8422)
This commit is contained in:
parent
b25b3493d9
commit
504655c92d
@ -973,7 +973,10 @@ class StockList(DataExportViewMixin, ListCreateDestroyAPIView):
|
|||||||
quantity = data['quantity'] = supplier_part.base_quantity(quantity)
|
quantity = data['quantity'] = supplier_part.base_quantity(quantity)
|
||||||
|
|
||||||
# Divide purchase price by pack size, to save correct price per stock item
|
# Divide purchase price by pack size, to save correct price per stock item
|
||||||
if data['purchase_price'] and supplier_part.pack_quantity_native:
|
if (
|
||||||
|
data.get('purchase_price')
|
||||||
|
and supplier_part.pack_quantity_native
|
||||||
|
):
|
||||||
try:
|
try:
|
||||||
data['purchase_price'] = float(
|
data['purchase_price'] = float(
|
||||||
data['purchase_price']
|
data['purchase_price']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user