anyblok_wms_base.core.wms.
Wms
[source]¶Namespace for WMS related models and transversal methods.
Since this Model does not have any persistent data, making instances of it is mostly irrelevant, and therefore, the transversal methods are classmethods.
quantity
(goods_type=None, additional_states=None, at_datetime=None, location=None, location_recurse=True, location_tag=<object object>)[source]¶Compute the quantity of Goods meeting various criteria.
The computation actually involves querying Avatars
, which hold the
information about location, states and date/time.
Parameters: |
|
---|
TODO: provide filtering according to Goods properties (should become special PostgreSQL JSON clauses)
TODO: provide a way to add more criteria from optional Bloks, e.g,
wms-reservation
could add a way to filter only unreserved Goods.
TODO PERF: for timestamp ranges, use GiST indexes and the @> operator. See the comprehensive answer to that question for an entry point. Let’s get a DB with serious volume and datetimes first.