diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index f5459ac22c6..ee4dcac5414 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -499,7 +499,7 @@ class mail_thread(osv.AbstractModel): posted = False for subtype in subtypes: - subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context, raise_exception=False) + subtype_rec = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, subtype, context=context) if not (subtype_rec and subtype_rec.exists()): _logger.debug('subtype %s not found' % subtype) continue diff --git a/addons/mail/update.py b/addons/mail/update.py index e285943d80b..b5938e36c3b 100644 --- a/addons/mail/update.py +++ b/addons/mail/update.py @@ -94,7 +94,7 @@ class publisher_warranty_contract(osv.osv): # old behavior based on res.log; now on mail.message, that is not necessarily installed IMD = self.pool['ir.model.data'] user = self.pool['res.users'].browse(cr, SUPERUSER_ID, SUPERUSER_ID) - poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees', context=context, raise_exception=False) + poster = IMD.xmlid_to_object(cr, SUPERUSER_ID, 'mail.group_all_employees', context=context) if not (poster and poster.exists()): if not user.exists(): return True diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index 3bc081c92cc..2468f42d732 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -120,7 +120,7 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""), user = self.pool.get('res.users').browse(cr, uid, uid, context) res['time_unit'] = user.company_id.project_time_mode_id.id else: - product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant', raise_exception=False) + product = ir_model_data.xmlid_to_object(cr, uid, 'product.product_product_consultant') if product and product.exists(): res['time_unit'] = product.uom_id.id return res @@ -138,7 +138,7 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""), wizard = self.browse(cr, uid, ids)[0] if wizard.time_unit: - product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant', raise_exception=False) + product = ir_model_data.xmlid_object(cr, uid, 'product.product_product_consultant') if product and product.exists(): product.write({'uom_id': wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id}) else: diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index aa31580cf2d..3d741ead4be 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -28,7 +28,7 @@ class stock_fill_inventory(osv.osv_memory): _description = "Import Inventory" def _default_location(self, cr, uid, ids, context=None): - location = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', raise_exception=False) + location = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, 'stock.stock_location_stock') if not location.exists(): return False try: