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

Updated Part model

- Added 'default_location'
- Added 'default_supplier'
This commit is contained in:
Oliver
2018-04-17 18:23:24 +10:00
parent 45c5edee4d
commit 982803a0a7
6 changed files with 80 additions and 1 deletions

View File

@ -88,7 +88,11 @@ class StockItemCreate(CreateView):
loc_id = self.request.GET.get('location', None)
if part_id:
initials['part'] = get_object_or_404(Part, pk=part_id)
part = get_object_or_404(Part, pk=part_id)
if part:
initials['part'] = get_object_or_404(Part, pk=part_id)
initials['location'] = part.default_location
initials['supplier_part'] = part.default_supplier
if loc_id:
initials['location'] = get_object_or_404(StockLocation, pk=loc_id)