mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 19:15:41 +00:00
Merge branch 'master' into customer_orders
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django.db import models, transaction
|
||||
from django.core.validators import MinValueValidator
|
||||
from django.contrib.auth.models import User
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user