mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "owner" field
This commit is contained in:
parent
4a0ed4b2a1
commit
d3b1ecd65e
@ -58,15 +58,15 @@ class StockItemSerializerBrief(InvenTreeModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = StockItem
|
model = StockItem
|
||||||
fields = [
|
fields = [
|
||||||
'pk',
|
|
||||||
'uid',
|
|
||||||
'part',
|
'part',
|
||||||
'part_name',
|
'part_name',
|
||||||
'supplier_part',
|
'pk',
|
||||||
'location',
|
'location',
|
||||||
'location_name',
|
'location_name',
|
||||||
'quantity',
|
'quantity',
|
||||||
'serial',
|
'serial',
|
||||||
|
'supplier_part',
|
||||||
|
'uid',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -208,6 +208,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
|||||||
'location',
|
'location',
|
||||||
'location_detail',
|
'location_detail',
|
||||||
'notes',
|
'notes',
|
||||||
|
'owner',
|
||||||
'packaging',
|
'packaging',
|
||||||
'part',
|
'part',
|
||||||
'part_detail',
|
'part_detail',
|
||||||
|
@ -94,8 +94,8 @@ function stockItemFields(options={}) {
|
|||||||
purchase_price_currency: {},
|
purchase_price_currency: {},
|
||||||
packaging: {},
|
packaging: {},
|
||||||
link: {},
|
link: {},
|
||||||
|
owner: {},
|
||||||
delete_on_deplete: {},
|
delete_on_deplete: {},
|
||||||
// owner: {},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Remove stock expiry fields if feature is not enabled
|
// Remove stock expiry fields if feature is not enabled
|
||||||
@ -103,6 +103,11 @@ function stockItemFields(options={}) {
|
|||||||
delete fields['expiry_date'];
|
delete fields['expiry_date'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove ownership field if feature is not enanbled
|
||||||
|
if (!global_settings.STOCK_OWNERSHIP_CONTROL) {
|
||||||
|
delete fields['owner'];
|
||||||
|
}
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user