summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2017-03-24 15:39:25 +0100
committerDamien Bouvy <dbo@odoo.com>2017-03-24 15:39:25 +0100
commit52b3b1f1bfb15c747e8f2381eaf939b85f2454db (patch)
treeb47d1443c9affe5a3ca6e9e85e550084ee6c6496
parent8d948d92350c858e3f5534020968bbfda4c8d154 (diff)
[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.
-rw-r--r--addons/purchase/purchase.py2
1 files changed, 1 insertions, 1 deletions
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 []