2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-29 18:20:53 +00:00

Merge branch 'inventree:master' into matmair/issue2279

This commit is contained in:
Matthias Mair
2022-02-20 22:19:30 +01:00
committed by GitHub
24 changed files with 27340 additions and 24841 deletions
InvenTree
InvenTree
locale
de
LC_MESSAGES
el
LC_MESSAGES
es
LC_MESSAGES
fr
LC_MESSAGES
he
LC_MESSAGES
id
LC_MESSAGES
it
LC_MESSAGES
ja
LC_MESSAGES
ko
LC_MESSAGES
nl
LC_MESSAGES
no
LC_MESSAGES
pl
LC_MESSAGES
pt
LC_MESSAGES
ru
LC_MESSAGES
sv
LC_MESSAGES
th
LC_MESSAGES
tr
LC_MESSAGES
vi
LC_MESSAGES
zh
LC_MESSAGES
part
stock

@ -475,7 +475,6 @@ def extract_serial_numbers(serials, expected_quantity, next_number: int):
continue
else:
errors.append(_("Invalid group: {g}").format(g=group))
continue
# plus signals either
# 1: 'start+': expected number of serials, starting at start
@ -500,7 +499,6 @@ def extract_serial_numbers(serials, expected_quantity, next_number: int):
# no case
else:
errors.append(_("Invalid group: {g}").format(g=group))
continue
# Group should be a number
elif group:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -789,8 +789,7 @@ class BomImportExtractSerializer(DataFileExtractSerializer):
pass
# No direct match, where else can we look?
if part is None:
if part_name or part_ipn:
if part is None and (part_name or part_ipn):
queryset = Part.objects.all()
if part_name:

@ -41,7 +41,7 @@ class BomUploadTest(InvenTreeAPITestCase):
assembly=False,
)
def post_bom(self, filename, file_data, part=None, clear_existing=None, expected_code=None, content_type='text/plain'):
def post_bom(self, filename, file_data, clear_existing=None, expected_code=None, content_type='text/plain'):
bom_file = SimpleUploadedFile(
filename,
@ -49,9 +49,6 @@ class BomUploadTest(InvenTreeAPITestCase):
content_type=content_type,
)
if part is None:
part = self.part.pk
if clear_existing is None:
clear_existing = False
@ -189,7 +186,7 @@ class BomUploadTest(InvenTreeAPITestCase):
self.assertIn('No part column specified', str(response.data))
response = self.post(
self.post(
url,
{
'rows': rows,

@ -516,9 +516,7 @@ class StockList(generics.ListCreateAPIView):
data['location'] = location.pk
# An expiry date was *not* specified - try to infer it!
if 'expiry_date' not in data:
if part.default_expiry > 0:
if 'expiry_date' not in data and part.default_expiry > 0:
data['expiry_date'] = datetime.now().date() + timedelta(days=part.default_expiry)
# Attempt to extract serial numbers from submitted data

@ -393,7 +393,7 @@ class StockItemTest(StockAPITestCase):
self.assertEqual(trackable_part.get_stock_count(), 0)
# This should fail, incorrect serial number count
response = self.post(
self.post(
self.list_url,
data={
'part': trackable_part.pk,