mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 11:10:54 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
@ -31,7 +31,6 @@ from InvenTree.models import InvenTreeTree
|
||||
from InvenTree.fields import InvenTreeURLField
|
||||
|
||||
from part import models as PartModels
|
||||
from order.models import PurchaseOrder, SalesOrder
|
||||
|
||||
|
||||
class StockLocation(InvenTreeTree):
|
||||
@ -134,7 +133,12 @@ class StockItem(MPTTModel):
|
||||
"""
|
||||
|
||||
# A Query filter which will be re-used in multiple places to determine if a StockItem is actually "in stock"
|
||||
IN_STOCK_FILTER = Q(sales_order=None, build_order=None, belongs_to=None)
|
||||
IN_STOCK_FILTER = Q(
|
||||
sales_order=None,
|
||||
build_order=None,
|
||||
belongs_to=None,
|
||||
status__in=StockStatus.AVAILABLE_CODES
|
||||
)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.pk:
|
||||
@ -393,7 +397,7 @@ class StockItem(MPTTModel):
|
||||
)
|
||||
|
||||
purchase_order = models.ForeignKey(
|
||||
PurchaseOrder,
|
||||
'order.PurchaseOrder',
|
||||
on_delete=models.SET_NULL,
|
||||
verbose_name=_('Source Purchase Order'),
|
||||
related_name='stock_items',
|
||||
@ -402,7 +406,7 @@ class StockItem(MPTTModel):
|
||||
)
|
||||
|
||||
sales_order = models.ForeignKey(
|
||||
SalesOrder,
|
||||
'order.SalesOrder',
|
||||
on_delete=models.SET_NULL,
|
||||
verbose_name=_("Destination Sales Order"),
|
||||
related_name='stock_items',
|
||||
|
@ -29,7 +29,7 @@
|
||||
<h4>{% trans "Stock Item Notes" %}</h4>
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
<button title='{% trans "Edit notes" %}' class='btn btn-default btn-glyph float-right' id='edit-notes'><span class='glyphicon glyphicon-edit'></span></button>
|
||||
<button title='{% trans "Edit notes" %}' class='btn btn-default action-button float-right' id='edit-notes'><span class='fas fa-edit'></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
@ -9,24 +9,24 @@
|
||||
<h3>{{ location.name }}</h3>
|
||||
<p>{{ location.description }}</p>
|
||||
{% else %}
|
||||
<h3>Stock</h3>
|
||||
<p>All stock items</p>
|
||||
<h3>{% trans "Stock" %}</h3>
|
||||
<p>{% trans "All stock items" %}</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<div class='btn-group action-buttons'>
|
||||
<button class='btn btn-default' id='location-create' title='Create new stock location'>
|
||||
<button class='btn btn-default' id='location-create' title='{% trans "Create new stock location" %}'>
|
||||
<span class='fas fa-plus-circle icon-green'/>
|
||||
</button>
|
||||
{% if location %}
|
||||
{% include "qr_button.html" %}
|
||||
<button class='btn btn-default' id='location-count' title='Count stock items'>
|
||||
<button class='btn btn-default' id='location-count' title='{% trans "Count stock items" %}'>
|
||||
<span class='fas fa-clipboard-list'/>
|
||||
</button>
|
||||
<button class='btn btn-default btn-glyph' id='location-edit' title='Edit stock location'>
|
||||
<button class='btn btn-default btn-glyph' id='location-edit' title='{% trans "Edit stock location" %}'>
|
||||
<span class='fas fa-edit icon-blue'/>
|
||||
</button>
|
||||
<button class='btn btn-default btn-glyph' id='location-delete' title='Delete stock location'>
|
||||
<span class='glyphicon glyphicon-trash icon-red'/>
|
||||
<button class='btn btn-default btn-glyph' id='location-delete' title='{% trans "Delete stock location" %}'>
|
||||
<span class='fas fa-trash-alt icon-red'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
||||
<input type='hidden' name='stock-id-{{ item.id }}' value='{{ item.new_quantity }}'/>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><button class='btn btn-default btn-remove' onclick='removeStockRow()' id='del-{{ item.id }}' title='Remove item' type='button'><span row='stock-row-{{ item.id }}' class='glyphicon glyphicon-small glyphicon-remove'></span></button></td>
|
||||
<td><button class='btn btn-default btn-remove' onclick='removeStockRow()' id='del-{{ item.id }}' title='Remove item' type='button'><span row='stock-row-{{ item.id }}' class='fas fa-trash-alt icon-red'></span></button></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
@ -14,6 +14,6 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
<li{% ifequal tab 'notes' %} class='active'{% endifequal %}>
|
||||
<a href="{% url 'stock-item-notes' item.id %}">{% trans "Notes" %}{% if item.notes %} <span class='glyphicon glyphicon-small glyphicon-info-sign'></span>{% endif %}</a>
|
||||
<a href="{% url 'stock-item-notes' item.id %}">{% trans "Notes" %}{% if item.notes %} <span class='fas fa-info-circle'></span>{% endif %}</a>
|
||||
</li>
|
||||
</ul>
|
Reference in New Issue
Block a user