model_data = self.pool.get('ir.model.data')
phonecall_dict = {}
if not categ_id:
- res_id = model_data._get_id(cr, uid, 'crm', 'categ_phone2')
- if res_id:
+ try:
+ res_id = model_data._get_id(cr, uid, 'crm', 'categ_phone2')
categ_id = model_data.browse(cr, uid, res_id, context=context).res_id
+ except ValueError:
+ pass
for lead in self.browse(cr, uid, ids, context=context):
if not section_id:
section_id = lead.section_id and lead.section_id.id or False
model_data = self.pool.get('ir.model.data')
phonecall_dict = {}
if not categ_id:
- res_id = model_data._get_id(cr, uid, 'crm', 'categ_phone2')
- if res_id:
+ try:
+ res_id = model_data._get_id(cr, uid, 'crm', 'categ_phone2')
categ_id = model_data.browse(cr, uid, res_id, context=context).res_id
+ except ValueError:
+ pass
for call in self.browse(cr, uid, ids, context=context):
if not section_id:
section_id = call.section_id and call.section_id.id or False
opp_obj = self.pool.get('crm.lead')
categ_id = False
data_obj = self.pool.get('ir.model.data')
- res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2')
- if res_id:
+ try:
+ res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2')
categ_id = data_obj.browse(cr, uid, res_id, context=context).res_id
+ except ValueError:
+ pass
record_ids = context and context.get('active_ids', []) or []
res = {}
categ_id = False
data_obj = self.pool.get('ir.model.data')
- res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2')
- if res_id:
+ try:
+ res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2')
categ_id = data_obj.browse(cr, uid, res_id, context=context).res_id
+ except ValueError:
+ pass
if 'name' in fields:
res.update({'name': phonecall.name})