So we can use it in group-by and filters. Note that we can have several
levels of areas... only the top-level will be used.
This commit fixes the computed field dependencies:
_compute_location_kind should have a dependency on both it's parent's
location_kind and on its child_ids to know if we are in a bin. This
can't work without triggering an infinite loop. The trick used here is
to split the computation of 'zone_location_id + area_location_id' in one
computed method, and move the computation of the kind in a different
method with triggers an the current record's zone_location +
area_location_id, but not on the parent.
Plus the zone_location_id and area_location_id do not depend anymore on
the parent's kind, which is the reason for the infinite loop.
* Compute the 'zone' fields in the same method
* Remove the dependency on 'zone_location_id', which seems to take
a lot of time if not an infinite loop
It prevents other addons to work properly such as the vertical lift.
We remove the constraint for now, maybe to be re-introduced later in a
more permissive way.
* Allow copy of stock locations (was blocked by constraint on unique name)
* Correct loop in _compute_name returning too early if a record had no
parent with a 'location_name_format'
* Rename field pick_type_id to picking_type_id for coherency
* Add missing _description on stock.picking.zone
* Correct location_name_format format when the record is a NewId