mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-06 05:30:56 +00:00
Adds metadata mixin class for adding JSON field to internal tables
- Add metadata field to stocklocation - Add metadata field to stockitem
This commit is contained in:
@ -38,6 +38,7 @@ import common.models
|
||||
import report.models
|
||||
import label.models
|
||||
|
||||
from plugin.models import MetadataMixin
|
||||
from plugin.events import trigger_event
|
||||
|
||||
from InvenTree.status_codes import StockStatus, StockHistoryCode
|
||||
@ -51,7 +52,7 @@ from company import models as CompanyModels
|
||||
from part import models as PartModels
|
||||
|
||||
|
||||
class StockLocation(InvenTreeTree):
|
||||
class StockLocation(MetadataMixin, InvenTreeTree):
|
||||
""" Organization tree for StockItem objects
|
||||
A "StockLocation" can be considered a warehouse, or storage location
|
||||
Stock locations can be heirarchical as required
|
||||
@ -242,7 +243,7 @@ def generate_batch_code():
|
||||
return Template(batch_template).render(context)
|
||||
|
||||
|
||||
class StockItem(MPTTModel):
|
||||
class StockItem(MetadataMixin, MPTTModel):
|
||||
"""
|
||||
A StockItem object represents a quantity of physical instances of a part.
|
||||
|
||||
|
Reference in New Issue
Block a user