From 55ebf486848f8fe327ebd9ce7666b9333e4a6e30 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 16 Sep 2019 09:43:57 +1000 Subject: [PATCH] Add more export fields for SupplierPart and SupplierPriceBreak --- InvenTree/company/admin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/InvenTree/company/admin.py b/InvenTree/company/admin.py index ce023aedc0..f69bfec54f 100644 --- a/InvenTree/company/admin.py +++ b/InvenTree/company/admin.py @@ -38,8 +38,12 @@ class SupplierPartResource(ModelResource): part = Field(attribute='part', widget=widgets.ForeignKeyWidget(Part)) + part_name = Field(attribute='part__full_name', readonly=True) + supplier = Field(attribute='supplier', widget=widgets.ForeignKeyWidget(Company)) + supplier_name = Field(attribute='supplier__name', readonly=True) + class Meta: model = SupplierPart skip_unchanged = True @@ -61,6 +65,16 @@ class SupplierPriceBreakResource(ModelResource): currency = Field(attribute='currency', widget=widgets.ForeignKeyWidget(Currency)) + supplier_id = Field(attribute='part__supplier__pk', readonly=True) + + supplier_name = Field(attribute='part__supplier__name', readonly=True) + + part_name = Field(attribute='part__part__full_name', readonly=True) + + SKU = Field(attribute='part__SKU', readonly=True) + + MPN = Field(attribute='part__MPN', readonly=True) + class Meta: model = SupplierPriceBreak skip_unchanged = True