mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
Start of API forms for stock item
This commit is contained in:
@ -134,7 +134,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
|
||||
tracking_items = serializers.IntegerField(source='tracking_info_count', read_only=True, required=False)
|
||||
|
||||
quantity = serializers.FloatField()
|
||||
# quantity = serializers.FloatField()
|
||||
|
||||
allocated = serializers.FloatField(source='allocation_count', required=False)
|
||||
|
||||
@ -142,20 +142,22 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
|
||||
stale = serializers.BooleanField(required=False, read_only=True)
|
||||
|
||||
serial = serializers.CharField(required=False)
|
||||
# serial = serializers.CharField(required=False)
|
||||
|
||||
required_tests = serializers.IntegerField(source='required_test_count', read_only=True, required=False)
|
||||
|
||||
purchase_price = InvenTreeMoneySerializer(
|
||||
label=_('Purchase Price'),
|
||||
max_digits=19, decimal_places=4,
|
||||
allow_null=True
|
||||
allow_null=True,
|
||||
help_text=_('Purchase price of this stock item'),
|
||||
)
|
||||
|
||||
purchase_price_currency = serializers.ChoiceField(
|
||||
choices=currency_code_mappings(),
|
||||
default=currency_code_default,
|
||||
label=_('Currency'),
|
||||
help_text=_('Purchase currency of this stock item'),
|
||||
)
|
||||
|
||||
purchase_price_string = serializers.SerializerMethodField()
|
||||
@ -197,6 +199,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
'belongs_to',
|
||||
'build',
|
||||
'customer',
|
||||
'delete_on_deplete',
|
||||
'expired',
|
||||
'expiry_date',
|
||||
'in_stock',
|
||||
|
@ -150,6 +150,7 @@
|
||||
<li><a href='#' id='stock-duplicate' title='{% trans "Duplicate stock item" %}'><span class='fas fa-copy'></span> {% trans "Duplicate stock item" %}</a></li>
|
||||
{% endif %}
|
||||
<li><a href='#' id='stock-edit' title='{% trans "Edit stock item" %}'><span class='fas fa-edit icon-blue'></span> {% trans "Edit stock item" %}</a></li>
|
||||
<li><a href='#' id='stock-edit-2' title='{% trans "Edit stock item" %}'><span class='fas fa-edit icon-blue'></span> {% trans "Edit stock item" %}</a></li>
|
||||
{% if user.is_staff or roles.stock.delete %}
|
||||
{% if item.can_delete %}
|
||||
<li><a href='#' id='stock-delete' title='{% trans "Delete stock item" %}'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete stock item" %}</a></li>
|
||||
@ -520,6 +521,10 @@ $("#stock-edit").click(function () {
|
||||
);
|
||||
});
|
||||
|
||||
$('#stock-edit-2').click(function() {
|
||||
editStockItem({{ item.pk }});
|
||||
});
|
||||
|
||||
$('#stock-edit-status').click(function () {
|
||||
|
||||
constructForm('{% url "api-stock-detail" item.pk %}', {
|
||||
|
Reference in New Issue
Block a user