Hi I'm creating a custom module to manage students, and I created a function to delete the leads from the database, but I'm getting the error: raise ValueError("Expected singleton: %s" % record)
-------This is my code--------
def action_set_lost(self, **additional_values):
for record in self:
result = super(CRM, record).action_set_lost(**additional_values)
partner_id = record.partner_id
cursos = record.x_interesado_en_curso
record._cr.execute("DELETE FROM x_product_product_res_partner_rel_cursos_en_lista_de_espera WHERE res_partner_id = " + str(partner_id.id) + " AND product_product_id = " + str(cursos.id))
return result
-----------------------------
Thanks everyone