anyblok_wms_base.quantity.physobj.
PhysObj
[source]¶Override to add the quantity
field.
quantity
= <anyblok.column.Decimal object>¶Quantity
Depending on the PhysObj Type, this represents in reality some physical measure (length of wire, weight of wheat) for PhysObj stored and handled in bulk, or a number of identical items, if goods are kept as individual pieces.
There is no corresponding idea of a unit of measure for bulk PhysObj, as we believe it to be enough to represent it in the PhysObj Type already (which would be, e.g, respectively a meter of wire, a ton of wheat). Note that bulk PhysObj can be the result of some Unpack, with the packaged version being itself handled as an individual piece (imagine spindles of 100m for the wire example) and further packable (pallets, containers…)
This field has been defined as Decimal to cover a broad scope of applications. However, for performance reasons, applications are free to overload this column with other numeric types (i.e., supporting transparently all the usual operations with the same syntax, both in Python and SQL).
Examples :
mpq
type on the PostgreSQL side), although it’s probably a better idea
if there’s an obvious common denominator to just use integers
(following on the example, simply have PhysObj Types representing
those thirds of pies alongside those representing the whole pies,
and represent the first cutting of a slice as an
Unpack)anyblok_wms_base.quantity.physobj.
Type
[source]¶Override to have behavorial tests for Split/Aggregate.
As a special case, the behaviours specify whether
Split
and
Aggregate
Operations are physical
(represent something happening in reality), and if that’s the case if they
are reversible, using {"reversible": true}
, defaulting to false
,
in the split
and aggregate
behaviours, respectively.
We don’t want to impose reversibility to be equal for both directions, as we don’t feel confident it would be true in all use cases (it is indeed in the ones presented below).
Reality of Split and Aggregate and their reversibilitues can be queried
using are_split_aggregate_physical()
,
is_split_reversible()
and is_aggregate_reversible()
Use cases: