mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Include status label text when exporting stocktake data
This commit is contained in:
parent
03043e67c7
commit
204cd967aa
@ -14,8 +14,6 @@ from django.views.generic import DetailView, ListView, FormView
|
|||||||
from django.forms.models import model_to_dict
|
from django.forms.models import model_to_dict
|
||||||
from django.forms import HiddenInput, CheckboxInput
|
from django.forms import HiddenInput, CheckboxInput
|
||||||
|
|
||||||
import tablib
|
|
||||||
|
|
||||||
from fuzzywuzzy import fuzz
|
from fuzzywuzzy import fuzz
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
|
@ -66,6 +66,8 @@ class StockItemResource(ModelResource):
|
|||||||
|
|
||||||
supplier_name = Field(attribute='supplier_part__supplier__name', readonly=True)
|
supplier_name = Field(attribute='supplier_part__supplier__name', readonly=True)
|
||||||
|
|
||||||
|
status_label = Field(attribute='status_label', readonly=True)
|
||||||
|
|
||||||
location = Field(attribute='location', widget=widgets.ForeignKeyWidget(StockLocation))
|
location = Field(attribute='location', widget=widgets.ForeignKeyWidget(StockLocation))
|
||||||
|
|
||||||
location_name = Field(attribute='location__name', readonly=True)
|
location_name = Field(attribute='location__name', readonly=True)
|
||||||
|
@ -140,6 +140,11 @@ class StockItem(models.Model):
|
|||||||
system=True
|
system=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def status_label(self):
|
||||||
|
|
||||||
|
return StockStatus.label(self.status)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def serialized(self):
|
def serialized(self):
|
||||||
""" Return True if this StockItem is serialized """
|
""" Return True if this StockItem is serialized """
|
||||||
|
@ -18,13 +18,10 @@ from InvenTree.views import AjaxView
|
|||||||
from InvenTree.views import AjaxUpdateView, AjaxDeleteView, AjaxCreateView
|
from InvenTree.views import AjaxUpdateView, AjaxDeleteView, AjaxCreateView
|
||||||
from InvenTree.views import QRCodeView
|
from InvenTree.views import QRCodeView
|
||||||
|
|
||||||
from InvenTree.status_codes import StockStatus
|
|
||||||
from InvenTree.helpers import str2bool, DownloadFile, GetExportFormats
|
from InvenTree.helpers import str2bool, DownloadFile, GetExportFormats
|
||||||
from InvenTree.helpers import ExtractSerialNumbers
|
from InvenTree.helpers import ExtractSerialNumbers
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import tablib
|
|
||||||
|
|
||||||
from company.models import Company
|
from company.models import Company
|
||||||
from part.models import Part
|
from part.models import Part
|
||||||
from .models import StockItem, StockLocation, StockItemTracking
|
from .models import StockItem, StockLocation, StockItemTracking
|
||||||
|
Loading…
x
Reference in New Issue
Block a user