Skip to content

Commit cd21195

Browse files
committed
Add MIN_API_VERSION to SalesOrderAllocation model. Workaround for old versions of server
1 parent 80ff58d commit cd21195

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

inventree/sales_order.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class SalesOrderAllocation(
196196
):
197197
"""Class representing the SalesOrderAllocation database model."""
198198

199+
MIN_API_VERSION = 267
199200
URL = 'order/so-allocation'
200201

201202
def getOrder(self):
@@ -204,7 +205,7 @@ def getOrder(self):
204205

205206
def getShipment(self):
206207
"""Return the SalesOrderShipment to which this SalesOrderAllocation belongs."""
207-
from sales_order import SalesOrderShipment
208+
# from sales_order import SalesOrderShipment
208209
return SalesOrderShipment(self._api, self.shipment)
209210

210211
def getLineItem(self):
@@ -275,7 +276,10 @@ def allocations(self):
275276
276277
Note: This is an overload of getAllocations() method, for legacy compatibility.
277278
"""
278-
return self.getAllocations()
279+
try:
280+
return self.getAllocations()
281+
except NotImplementedError:
282+
return self._data['allocations']
279283

280284
def complete(
281285
self,

0 commit comments

Comments
 (0)