mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
commit
731ce6c342
@ -15,6 +15,8 @@ from .models import PartParameterTemplate, PartParameter
|
||||
from .models import PartTestTemplate
|
||||
from .models import PartSellPriceBreak
|
||||
|
||||
from InvenTree.helpers import normalize
|
||||
|
||||
from stock.models import StockLocation
|
||||
from company.models import SupplierPart
|
||||
|
||||
@ -165,6 +167,15 @@ class BomItemResource(ModelResource):
|
||||
# Is the sub-part itself an assembly?
|
||||
sub_assembly = Field(attribute='sub_part__assembly', readonly=True)
|
||||
|
||||
def dehydrate_quantity(self, item):
|
||||
"""
|
||||
Special consideration for the 'quantity' field on data export.
|
||||
We do not want a spreadsheet full of "1.0000" (we'd rather "1")
|
||||
|
||||
Ref: https://django-import-export.readthedocs.io/en/latest/getting_started.html#advanced-data-manipulation-on-export
|
||||
"""
|
||||
return normalize(item.quantity)
|
||||
|
||||
def before_export(self, queryset, *args, **kwargs):
|
||||
|
||||
self.is_importing = kwargs.get('importing', False)
|
||||
|
18
InvenTree/templates/404.html
Normal file
18
InvenTree/templates/404.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}
|
||||
InvenTree | {% trans "Page Not Found" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class='container-fluid'>
|
||||
<h3>{% trans "Page Not Found" %}</h3>
|
||||
|
||||
<div class='alert alert-danger alert-block'>
|
||||
{% trans "The requested page does not exist" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user