[BUG] ValueError on Part page

Fixes #2756
This commit is contained in:
Matthias 2022-03-17 23:56:48 +01:00
parent adc44184b6
commit 771f6de93a
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -441,9 +441,9 @@ class PartDetail(InvenTreeRoleMixin, DetailView):
# set date for graph labels # set date for graph labels
if stock_item.purchase_order and stock_item.purchase_order.issue_date: if stock_item.purchase_order and stock_item.purchase_order.issue_date:
line['date'] = stock_item.purchase_order.issue_date.strftime('%d.%m.%Y') line['date'] = stock_item.purchase_order.issue_date.isoformat()
elif stock_item.tracking_info.count() > 0: elif stock_item.tracking_info.count() > 0:
line['date'] = stock_item.tracking_info.first().date.strftime('%d.%m.%Y') line['date'] = stock_item.tracking_info.first().date.isoformat()
else: else:
# Not enough information # Not enough information
continue continue
@ -500,9 +500,9 @@ class PartDetail(InvenTreeRoleMixin, DetailView):
# set date for graph labels # set date for graph labels
if sale_item.order.issue_date: if sale_item.order.issue_date:
line['date'] = sale_item.order.issue_date.strftime('%d.%m.%Y') line['date'] = sale_item.order.issue_date.isoformat()
elif sale_item.order.creation_date: elif sale_item.order.creation_date:
line['date'] = sale_item.order.creation_date.strftime('%d.%m.%Y') line['date'] = sale_item.order.creation_date.isoformat()
else: else:
line['date'] = _('None') line['date'] = _('None')