Skip to content

Commit d12e52a

Browse files
authored
Improve compatibility with older versionof InvenTree Server. (#251)
* Add MIN_API_VERSION to SalesOrderAllocation model. Workaround for old versions of server * Revert unintended change
1 parent 80ff58d commit d12e52a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

inventree/sales_order.py

Lines changed: 5 additions & 1 deletion
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):
@@ -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)