mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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 import HiddenInput, CheckboxInput
|
||||
|
||||
import tablib
|
||||
|
||||
from fuzzywuzzy import fuzz
|
||||
from decimal import Decimal
|
||||
|
||||
|
@ -66,6 +66,8 @@ class StockItemResource(ModelResource):
|
||||
|
||||
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_name = Field(attribute='location__name', readonly=True)
|
||||
|
@ -140,6 +140,11 @@ class StockItem(models.Model):
|
||||
system=True
|
||||
)
|
||||
|
||||
@property
|
||||
def status_label(self):
|
||||
|
||||
return StockStatus.label(self.status)
|
||||
|
||||
@property
|
||||
def serialized(self):
|
||||
""" 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 QRCodeView
|
||||
|
||||
from InvenTree.status_codes import StockStatus
|
||||
from InvenTree.helpers import str2bool, DownloadFile, GetExportFormats
|
||||
from InvenTree.helpers import ExtractSerialNumbers
|
||||
from datetime import datetime
|
||||
|
||||
import tablib
|
||||
|
||||
from company.models import Company
|
||||
from part.models import Part
|
||||
from .models import StockItem, StockLocation, StockItemTracking
|
||||
|
Loading…
Reference in New Issue
Block a user