mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-20 03:36:30 +00:00
Merge branch 'master' into partial-shipment
# Conflicts: # InvenTree/build/serializers.py # InvenTree/order/templates/order/so_sidebar.html
This commit is contained in:
.github/workflows
InvenTree
InvenTree
api_tester.pyci_render_js.pyfields.pyfilters.pymetadata.pyserializers.pysettings.pytasks.pytest_api.pyurls.pyversion.py
management
commands
static
script
inventree
build
common
company
label
locale
de
el
en
LC_MESSAGES
es
es_MX
fr
he
id
it
ja
ko
nl
no
pl
pt
LC_MESSAGES
ru
sv
th
tr
vi
zh
order
part
admin.pyapi.pybom.pyforms.pymodels.pyserializers.pytasks.py
templates
part
templatetags
test_api.pytest_bom_item.pytest_part.pytest_views.pyurls.pyviews.pyreport
stock
templates
ci
setup.cfgtasks.py@@ -309,7 +309,7 @@ class BuildAllocationItemSerializer(serializers.Serializer):
|
||||
)
|
||||
|
||||
def validate_bom_item(self, bom_item):
|
||||
|
||||
|
||||
# TODO: Fix this validation - allow for variants and substitutes!
|
||||
|
||||
build = self.context['build']
|
||||
@@ -332,7 +332,7 @@ class BuildAllocationItemSerializer(serializers.Serializer):
|
||||
|
||||
if not stock_item.in_stock:
|
||||
raise ValidationError(_("Item must be in stock"))
|
||||
|
||||
|
||||
return stock_item
|
||||
|
||||
quantity = serializers.DecimalField(
|
||||
@@ -398,7 +398,7 @@ class BuildAllocationItemSerializer(serializers.Serializer):
|
||||
|
||||
# Output *cannot* be set for un-tracked parts
|
||||
if output is not None and not bom_item.sub_part.trackable:
|
||||
|
||||
|
||||
raise ValidationError({
|
||||
'output': _('Build output cannot be specified for allocation of untracked parts')
|
||||
})
|
||||
@@ -422,14 +422,14 @@ class BuildAllocationSerializer(serializers.Serializer):
|
||||
"""
|
||||
Validation
|
||||
"""
|
||||
|
||||
|
||||
data = super().validate(data)
|
||||
|
||||
items = data.get('items', [])
|
||||
|
||||
if len(items) == 0:
|
||||
raise ValidationError(_('Allocation items must be provided'))
|
||||
|
||||
|
||||
return data
|
||||
|
||||
def save(self):
|
||||
|
Reference in New Issue
Block a user