[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.
This commit is contained in:
Damien Bouvy
2017-03-24 15:39:25 +01:00
parent 8d948d9235
commit 52b3b1f1bf
+1 -1
View File
@@ -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 []