I try to do it:
I get an error that 'my_module' has no attribute 'cr'. I fixed it by replacing cr = self.env.cr and I continue to get other error : 'psycopg2.extensions.cursor' object has no attribute 'excute'. Please give me advice.
recipient_model_real = fields.Selection(selection='get_contact',required=True)@api.crdef get_contacts(self): cr = self.cr cr.excute("SELECT name FROM sms_mass_sms_contacts_sms_list where name!= NULL;") result = cr.dictfetchall() data = simplejson.load(result) return data.item()