2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +00:00

Merge remote-tracking branch 'inventree/master' into settings-refactor

This commit is contained in:
Oliver
2021-07-27 14:28:17 +10:00
27 changed files with 98667 additions and 26579 deletions

View File

@ -995,8 +995,9 @@ class BomList(generics.ListCreateAPIView):
# Get values for currencies
currencies = queryset.annotate(
purchase_price=F('sub_part__stock_items__purchase_price'),
purchase_price_currency=F('sub_part__stock_items__purchase_price_currency'),
).values('pk', 'sub_part', 'purchase_price_currency')
).values('pk', 'sub_part', 'purchase_price', 'purchase_price_currency')
def convert_price(price, currency, decimal_places=4):
""" Convert price field, returns Money field """
@ -1032,7 +1033,7 @@ class BomList(generics.ListCreateAPIView):
# Find associated currency (select first found)
purchase_price_currency = None
for currency_item in currencies:
if currency_item['pk'] == bom_item.pk and currency_item['sub_part'] == bom_item.sub_part.pk:
if currency_item['pk'] == bom_item.pk and currency_item['sub_part'] == bom_item.sub_part.pk and currency_item['purchase_price']:
purchase_price_currency = currency_item['purchase_price_currency']
break
# Convert prices

View File

@ -416,7 +416,7 @@
});
// Wait for *all* the requests to complete
$.when.apply($, requests).then(function() {
$.when.apply($, requests).done(function() {
location.reload();
});
}
@ -832,7 +832,7 @@
requests.push(inventreeDelete(url));
});
$.when.apply($, requests).then(function() {
$.when.apply($, requests).done(function() {
reloadSupplierPartTable();
});
}