From 52b3b1f1bfb15c747e8f2381eaf939b85f2454db Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Fri, 24 Mar 2017 15:39:25 +0100 Subject: [PATCH] [FIX] purchase: don't raise if standard route is deleted New api regression: xmlid_to_res_id() had the flag to raise set to false by default while ref() does the opposite. Since the intent here was clearly to allow not finding the record (given the if condition under the ref call), avoid crashing for a simple default. --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 1f6d7e2bfed..061fb804ab0 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -983,7 +983,7 @@ class ProductTemplate(models.Model): @api.model def _get_buy_route(self): - buy_route = self.env.ref('purchase.route_warehouse0_buy') + buy_route = self.env.ref('purchase.route_warehouse0_buy', raise_if_not_found=False) if buy_route: return buy_route.ids return []