stock_mts_mto_rule: remove useless constraint

Having the same src location is not needed and maybe wanted in some case
For example the Manufacturing can be done in an other warehouse
This commit is contained in:
Sébastien BEAU
2022-06-06 09:14:06 +02:00
committed by Florian da Costa
parent 8af1607944
commit 03a6baede8

View File

@@ -25,16 +25,6 @@ class StockRule(models.Model):
"No MTS or MTO rule configured on procurement " "rule: %s!"
) % (rule.name,)
raise ValidationError(msg)
if (
rule.mts_rule_id.location_src_id.id
!= rule.mto_rule_id.location_src_id.id
):
msg = _(
"Inconsistency between the source locations of "
"the mts and mto rules linked to the procurement "
"rule: %s! It should be the same."
) % (rule.name,)
raise ValidationError(msg)
def get_mto_qty_to_order(self, product, product_qty, product_uom, values):
self.ensure_one()