mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Specify ForeignKey widget for importing destination field (#6205)
- Fixes https://github.com/inventree/InvenTree/issues/6201
This commit is contained in:
parent
df8b480abb
commit
7f231cb6c1
@ -7,6 +7,7 @@ from import_export import widgets
|
||||
from import_export.admin import ImportExportModelAdmin
|
||||
from import_export.fields import Field
|
||||
|
||||
import stock.models
|
||||
from InvenTree.admin import InvenTreeResource
|
||||
from order import models
|
||||
|
||||
@ -173,6 +174,11 @@ class PurchaseOrderLineItemResource(PriceResourceMixin, InvenTreeResource):
|
||||
|
||||
SKU = Field(attribute='part__SKU', readonly=True)
|
||||
|
||||
destination = Field(
|
||||
attribute='destination',
|
||||
widget=widgets.ForeignKeyWidget(stock.models.StockLocation),
|
||||
)
|
||||
|
||||
def dehydrate_purchase_price(self, line):
|
||||
"""Return a string value of the 'purchase_price' field, rather than the 'Money' object."""
|
||||
if line.purchase_price:
|
||||
|
Loading…
Reference in New Issue
Block a user