Skip to content

Version 0.17.1 breaks compatibility for shipment allocations. #250

@miggland

Description

@miggland

I appreciate that you have tried to make this legacy-compatible through line 273 in sales_order.py (def allocations...), but it seems that version 0.16.9 of InvenTree doesn't support the search parameter ?shipment=<id> , such that shp.allocations now returns all allocations, and no longer those specific to the shipment..

I always assumed that the inventree-python version was more-or-less independent of the InvenTree server version, and that the API version check would take care of discrepancies.

PoC:

Using inventree-python on master branch.

Against demo server, the results are as expected:

>>> shp = SalesOrderShipment(api, 3)
>>> for S in shp.allocations: S.shipment
... 
3
3
3

Against my own server, running 0.16.9:

>>> shp = SalesOrderShipment(api, 67)
>>> for S in shp.allocations: S.shipment
... 
1
3
6
6
6
6
8
...
64
64
63
66
67

The list includes 202 items - whereas the shipment actually only has one allocation, as correctly contained in shp._data['allocations

>>> for s in shp._data['allocations']: S.shipment
... 
67

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions