Add 'title' option for contsructed fields

This commit is contained in:
Oliver 2021-07-12 21:11:29 +10:00
parent 52eedef820
commit 77cfadad42
3 changed files with 6 additions and 4 deletions

View File

@ -120,9 +120,6 @@ class StockAdjust(APIView):
- StockAdd: add stock items - StockAdd: add stock items
- StockRemove: remove stock items - StockRemove: remove stock items
- StockTransfer: transfer stock items - StockTransfer: transfer stock items
# TODO - This needs serious refactoring!!!
""" """
queryset = StockItem.objects.none() queryset = StockItem.objects.none()
@ -502,7 +499,6 @@ class StockList(generics.ListCreateAPIView):
serializer = self.get_serializer(data=request.data) serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True) serializer.is_valid(raise_exception=True)
# TODO - Save the user who created this item
item = serializer.save() item = serializer.save()
# A location was *not* specified - try to infer it # A location was *not* specified - try to infer it

View File

@ -1473,6 +1473,11 @@ function constructInputOptions(name, classes, type, parameters) {
opts.push(`required=''`); opts.push(`required=''`);
} }
// Custom mouseover title?
if (parameters.title != null) {
opts.push(`title='${parameters.title}'`);
}
// Placeholder? // Placeholder?
if (parameters.placeholder != null) { if (parameters.placeholder != null) {
opts.push(`placeholder='${parameters.placeholder}'`); opts.push(`placeholder='${parameters.placeholder}'`);

View File

@ -147,6 +147,7 @@ function adjustStock(action, items, options={}) {
min_value: minValue, min_value: minValue,
max_value: maxValue, max_value: maxValue,
read_only: readonly, read_only: readonly,
title: readonly ? '{% trans "Quantity cannot be adjusted for serialized stock" %}' : '{% trans "Specify stock quantity" %}',
} }
) )
}; };