2
0
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:
James Newlands
2018-04-17 23:06:41 +10:00
24 changed files with 530 additions and 53 deletions

View File

@ -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

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)