|
Hi all, Inventree 1.4.2 I am calling Inventree-Python function PartCategory.list with an empty PARENT parameter, but instead of returning the expected few top level entries, the function is returning all categories. These are the output as stored in LO Calc. (no company secret info here) I expect to only receive categories such as Documents and Electrical, but I also receive their child categories too. Am I doing something incorrect ? Is this a bug that needs filing ? Many thanks, |
Replies: 1 comment 1 reply
|
Use the dedicated categories = PartCategory.list(api, top_level=True)In InvenTree 1.4.2, that filter applies
See the |
Use the dedicated
top_levelfilter:In InvenTree 1.4.2, that filter applies
parent=Noneand returns only root categories.parent=''is treated as an empty value by the parent filter, so no parent filtering is applied and the endpoint returns every category. This is not related to LibreOffice; theparent=''example in the Python documentation does not match the 1.4.2 server behavior.See the
top_levelfilter implementation.