2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00

Add function to get the default location for a part

- If field not specified, look at the part category
This commit is contained in:
Oliver Walters
2019-05-04 19:06:39 +10:00
parent f270375847
commit 71972f4454
2 changed files with 16 additions and 1 deletions

View File

@ -211,7 +211,7 @@ class StockItemCreate(AjaxCreateView):
try:
part = Part.objects.get(pk=part_id)
initials['part'] = part
initials['location'] = part.default_location
initials['location'] = part.get_default_location()
initials['supplier_part'] = part.default_supplier
except Part.DoesNotExist:
pass