summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/stock/models/procurement.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py
index 2b51cf9f66a..cb1072efe50 100644
--- a/addons/stock/models/procurement.py
+++ b/addons/stock/models/procurement.py
@@ -184,7 +184,10 @@ class ProcurementGroup(models.Model):
if not rule:
raise UserError(_('No procurement rule found. Please verify the configuration of your routes'))
- getattr(rule, '_run_%s' % rule.action)(product_id, product_qty, product_uom, location_id, name, origin, values)
+ if hasattr(rule, '_run_%s' % rule.action):
+ getattr(rule, '_run_%s' % rule.action)(product_id, product_qty, product_uom, location_id, name, origin, values)
+ else:
+ _logger.error("The method _run_%s doesn't exist on the procument rules" % rule.action)
return True
@api.model