Commit b11f4fca authored by Jérome Perrin's avatar Jérome Perrin

document that complex queries are supported

parent 4100a516
...@@ -349,6 +349,7 @@ Allows to only consider incoming or outgoing movements. ...@@ -349,6 +349,7 @@ Allows to only consider incoming or outgoing movements.
Grouping parameters are for getInventoryList, but they also can be applied to getMovementHistoryList. Grouping parameters are for getInventoryList, but they also can be applied to getMovementHistoryList.
#### misc #### misc
- only_accountable: only take into account accountable movements. Default is *True* - only_accountable: only take into account accountable movements. Default is *True*
- precision: the precision used to round quantities and prices - precision: the precision used to round quantities and prices
...@@ -357,6 +358,24 @@ Grouping parameters are for getInventoryList, but they also can be applied to ge ...@@ -357,6 +358,24 @@ Grouping parameters are for getInventoryList, but they also can be applied to ge
- transformed_resource: the resource or list of resource that can be produced using the resulting movement's resource as an input. *relative_resource_url* for each line will point to the transformed resource, while the stock will be expressed in number of the respective transformed resources **(XXX: what does this actually mean?)** - transformed_resource: the resource or list of resource that can be produced using the resulting movement's resource as an input. *relative_resource_url* for each line will point to the transformed resource, while the stock will be expressed in number of the respective transformed resources **(XXX: what does this actually mean?)**
- transformed_variation_text: to be used with *transformed_resource* to refine the transformation selection only to those using variated resources as input - transformed_variation_text: to be used with *transformed_resource* to refine the transformation selection only to those using variated resources as input
#### Queries
Note that all inventory API methods supports `Query` arguments, which allows to do advanced queries.
For example, to get movements going to A or to nowhere, you can do:
```python
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
portal.portal_simulation.getMovementHistoryList(
query=ComplexQuery([
SimpleQuery(node_uid=A.getUid()),
SimpleQuery(node_uid=None)],
operator="OR"))
```
TODO: this should be covered in testInventoryAPI as well.
# Inventory "documents" # Inventory "documents"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment