diff --git a/addons/mrp/models/stock_warehouse.py b/addons/mrp/models/stock_warehouse.py index 1036f19c5b1..8f38dfad3c3 100644 --- a/addons/mrp/models/stock_warehouse.py +++ b/addons/mrp/models/stock_warehouse.py @@ -29,12 +29,12 @@ class StockWarehouse(models.Model): return result def _get_manufacture_route_id(self): - manufacture_route_id = self.env.ref('mrp.route_warehouse0_manufacture').id - if not manufacture_route_id: - manufacture_route_id = self.env['stock.location.route'].search([('name', 'like', _('Manufacture'))], limit=1).id - if not manufacture_route_id: + manufacture_route = self.env.ref('mrp.route_warehouse0_manufacture', raise_if_not_found=False) + if not manufacture_route: + manufacture_route = self.env['stock.location.route'].search([('name', 'like', _('Manufacture'))], limit=1) + if not manufacture_route: raise exceptions.UserError(_('Can\'t find any generic Manufacture route.')) - return manufacture_route_id + return manufacture_route.id def _get_manufacture_pull_rules_values(self, route_values): if not self.manu_type_id: diff --git a/addons/product/report/product_product_templates.xml b/addons/product/report/product_product_templates.xml index 8fb2bf122d7..66f9594a529 100644 --- a/addons/product/report/product_product_templates.xml +++ b/addons/product/report/product_product_templates.xml @@ -17,7 +17,9 @@