mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Peppy fixes
This commit is contained in:
parent
1290e7f289
commit
3405fb93a9
@ -112,7 +112,8 @@ class PurchaseOrder(Order):
|
||||
help_text=_('Company')
|
||||
)
|
||||
|
||||
received_by = models.ForeignKey(User,
|
||||
received_by = models.ForeignKey(
|
||||
User,
|
||||
on_delete=models.SET_NULL,
|
||||
blank=True, null=True,
|
||||
related_name='+'
|
||||
@ -242,7 +243,6 @@ class PurchaseOrder(Order):
|
||||
po=str(self))
|
||||
)
|
||||
|
||||
|
||||
# Update the number of parts received against the particular line item
|
||||
line.received += quantity
|
||||
line.save()
|
||||
@ -313,4 +313,4 @@ class PurchaseOrderLineItem(OrderLineItem):
|
||||
def remaining(self):
|
||||
""" Calculate the number of items remaining to be received """
|
||||
r = self.quantity - self.received
|
||||
return max(r, 0)
|
||||
return max(r, 0)
|
||||
|
@ -5,7 +5,6 @@ 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
|
||||
@ -252,7 +251,7 @@ class PurchaseOrderReceive(AjaxView):
|
||||
receive = int(receive)
|
||||
except ValueError:
|
||||
# In the case on an invalid input, reset to default
|
||||
receive = line.remaining()
|
||||
receive = line.remaining()
|
||||
errors = True
|
||||
|
||||
if receive < 0:
|
||||
|
@ -251,7 +251,7 @@ class StockItem(models.Model):
|
||||
updated = models.DateField(auto_now=True, null=True)
|
||||
|
||||
purchase_order = models.ForeignKey(
|
||||
'order.PurchaseOrder',
|
||||
'order.PurchaseOrder',
|
||||
on_delete=models.SET_NULL,
|
||||
related_name='stock_items',
|
||||
blank=True, null=True,
|
||||
|
Loading…
Reference in New Issue
Block a user