mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #517 from SchrodingersGat/po-bug-fix
Bug fix for order-parts form
This commit is contained in:
commit
2e3ee23d8d
@ -202,8 +202,8 @@ class PurchaseOrder(Order):
|
|||||||
raise ValidationError({'supplier': _("Part supplier must match PO supplier")})
|
raise ValidationError({'supplier': _("Part supplier must match PO supplier")})
|
||||||
|
|
||||||
if group:
|
if group:
|
||||||
# Check if there is already a matching line item
|
# Check if there is already a matching line item (for this PO)
|
||||||
matches = PurchaseOrderLineItem.objects.filter(part=supplier_part)
|
matches = self.lines.filter(part=supplier_part)
|
||||||
|
|
||||||
if matches.count() > 0:
|
if matches.count() > 0:
|
||||||
line = matches.first()
|
line = matches.first()
|
||||||
|
@ -5,6 +5,7 @@ Django views for interacting with Order app
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import transaction
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.views.generic import DetailView, ListView
|
from django.views.generic import DetailView, ListView
|
||||||
@ -557,6 +558,7 @@ class OrderParts(AjaxView):
|
|||||||
|
|
||||||
return self.renderJsonResponse(self.request, data=data)
|
return self.renderJsonResponse(self.request, data=data)
|
||||||
|
|
||||||
|
@transaction.atomic
|
||||||
def order_items(self):
|
def order_items(self):
|
||||||
""" Add the selected items to the purchase orders. """
|
""" Add the selected items to the purchase orders. """
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user