diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-01-24 11:43:52 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-01-24 11:43:52 +0700 |
| commit | 2a3a0a7e88ef24456eeda070a7d74f1457efdb18 (patch) | |
| tree | 2bb4cd374d46b5d5e4fb6e32fe239c5ccc83daf4 /indoteknik_custom/models/crm_lead.py | |
| parent | 287cf8497b4b6bb825870ee2b3d1b49d4c29ab6a (diff) | |
| parent | 646b9e22fc11f6f1d1b556761a3df2df61f8f59b (diff) | |
Merge branch 'release' into staging
Diffstat (limited to 'indoteknik_custom/models/crm_lead.py')
| -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: |
