|
@@ -33,10 +33,8 @@ class res_partner(osv.osv):
|
|
|
try:
|
|
|
for partner in self.browse(cr, uid, ids, context):
|
|
|
operator = '='
|
|
|
- ini_ids = self.pool['crm.lead'].search(cr, uid, [('partner_id', operator, partner.id), ('type', '=', 'lead')], context=context)
|
|
|
- res[partner.id] = {
|
|
|
- 'iniciativa_count': len(ini_ids),
|
|
|
- }
|
|
|
+ iniciativa_ids = self.pool['crm.lead'].search(cr, uid, [('partner_id', operator, partner.id), ('type', '=', 'lead')], context=context)
|
|
|
+ res[partner.id] = len(partner.iniciativa_ids)
|
|
|
except:
|
|
|
pass
|
|
|
return res
|
|
@@ -44,5 +42,5 @@ class res_partner(osv.osv):
|
|
|
_columns = {
|
|
|
'iniciativa_ids': fields.one2many('crm.lead', 'partner_id',\
|
|
|
'Leads'),
|
|
|
- 'iniciativa_count': fields.function(_iniciativa_count, string="Lead", type='integer'),
|
|
|
+ 'iniciativa_count': fields.function(_iniciativa_count, string='Lead', type='integer'),
|
|
|
}
|