Remove implicit fallback when rules are used

When rules are configured and have been applied, we should not
have an implicit fallback on the base location, as it would kind
of cancel the benefits of the rules (as it would then take whatever
it wants anywhere in all the locations).
This commit is contained in:
Guewen Baconnier
2020-05-28 07:59:43 +02:00
parent ffef9da690
commit bf3e5867dc

View File

@@ -103,16 +103,7 @@ class StockMove(models.Model):
break
reserved = need - still_need
# Implicit fallback on the original location
return reserved + super()._update_reserved_quantity(
still_need,
available_quantity - reserved,
location_id=location_id,
lot_id=lot_id,
package_id=package_id,
owner_id=owner_id,
strict=strict,
)
return reserved
# We fall here if there is no rule or they have all been
# excluded by 'rule._is_rule_applicable'