mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 05:26:45 +00:00
Fix for build complete form
This commit is contained in:
parent
646dd65d27
commit
2b99cf353a
@ -323,7 +323,7 @@ class Build(MPTTModel):
|
|||||||
if not self.isPartFullyAllocated(part):
|
if not self.isPartFullyAllocated(part):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def isPartFullyAllocated(self, part):
|
def isPartFullyAllocated(self, part):
|
||||||
"""
|
"""
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
|
|
||||||
<h4>{% trans "Build" %} - {{ build }}</h4>
|
<h4>{% trans "Build" %} - {{ build }}</h4>
|
||||||
|
|
||||||
{% if not build.isFullyAllocated %}
|
{% if build.isFullyAllocated %}
|
||||||
|
<div class='alert alert-block alert-info'>
|
||||||
|
<h4>{% trans "Build order allocation is complete" %}</h4>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
<div class='alert alert-block alert-danger'>
|
<div class='alert alert-block alert-danger'>
|
||||||
<h4>{% trans "Warning: Build order allocation is not complete" %}</h4>
|
<h4>{% trans "Warning: Build order allocation is not complete" %}</h4>
|
||||||
{% trans "Build Order has not been fully allocated. Ensure that all Stock Items have been allocated to the Build" %}
|
{% trans "Build Order has not been fully allocated. Ensure that all Stock Items have been allocated to the Build" %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
|
||||||
<div class='alert alert-block alert-info'>
|
|
||||||
<h4>{% trans "Build order allocation is complete" %}</h4>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class='alert alert-block alert-success'>
|
<div class='alert alert-block alert-success'>
|
||||||
|
@ -541,7 +541,8 @@ class SalesOrderAllocation(models.Model):
|
|||||||
if self.quantity > self.item.quantity:
|
if self.quantity > self.item.quantity:
|
||||||
errors['quantity'] = _('Allocation quantity cannot exceed stock quantity')
|
errors['quantity'] = _('Allocation quantity cannot exceed stock quantity')
|
||||||
|
|
||||||
if self.item.quantity - self.item.allocation_count() < self.quantity:
|
# TODO: The logic here needs improving. Do we need to subtract our own amount, or something?
|
||||||
|
if self.item.quantity - self.item.allocation_count() + self.quantity < self.quantity:
|
||||||
errors['quantity'] = _('StockItem is over-allocated')
|
errors['quantity'] = _('StockItem is over-allocated')
|
||||||
|
|
||||||
if self.quantity <= 0:
|
if self.quantity <= 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user