Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2019-09-13 15:38:41 +10:00
commit 625ab33bc8
2 changed files with 4 additions and 2 deletions

View File

@ -202,8 +202,8 @@ class PurchaseOrder(Order):
raise ValidationError({'supplier': _("Part supplier must match PO supplier")})
if group:
# Check if there is already a matching line item
matches = PurchaseOrderLineItem.objects.filter(part=supplier_part)
# Check if there is already a matching line item (for this PO)
matches = self.lines.filter(part=supplier_part)
if matches.count() > 0:
line = matches.first()

View File

@ -5,6 +5,7 @@ Django views for interacting with Order app
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import transaction
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _
from django.views.generic import DetailView, ListView
@ -557,6 +558,7 @@ class OrderParts(AjaxView):
return self.renderJsonResponse(self.request, data=data)
@transaction.atomic
def order_items(self):
""" Add the selected items to the purchase orders. """