From b8fec90fb466b335980c170bca32c3c01db9bdc6 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Mon, 27 Jan 2014 11:35:05 +0100 Subject: [PATCH] [FIX] sale: ir_model_data.get_object(..., check=False) may return False bzr revid: rco@openerp.com-20140127103505-kujpcjpgr5rdxni9 --- addons/sale/res_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index accbb8b04a9..df36754434b 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -121,7 +121,7 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""), res['time_unit'] = user.company_id.project_time_mode_id.id else: product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant', check=False) - if product.exists(): + if product and product.exists(): res['time_unit'] = product.uom_id.id return res @@ -139,7 +139,7 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""), if wizard.time_unit: product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant', check=False) - if product.exists(): + if product and product.exists(): product.write({'uom_id': wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id}) else: _logger.warning("Product with xml_id 'product.product_product_consultant' not found, UoMs not updated!")