diff options
| -rwxr-xr-x | indoteknik_custom/models/crm_lead.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py index e0a90d9c..3c8b842b 100755 --- a/indoteknik_custom/models/crm_lead.py +++ b/indoteknik_custom/models/crm_lead.py @@ -11,6 +11,15 @@ class CrmLead(models.Model): file_siup = fields.Binary(string="Surat Izin Usaha Perdagangan") body_html_lead = fields.Text('Body HTML', compute='compute_body_leads') + def revert_to_leads(self): + opportunities = self.env['crm.lead'].search([ + ('type', '=', 'opportunity'), + ('active', '=', True), + ('user_id', '=', False), + ]) + for opportunity in opportunities: + opportunity.type = 'lead' + @api.onchange('stage_id') def update_stars(self): for lead in self: |
