summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-01-19 14:47:10 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-01-19 14:47:10 +0700
commitcf29c503c23a76cfe0038fa7faa7be36d5f969ae (patch)
treed094927eecb917d34126413932a9e515a7d18a94
parent74e22ea21d16389937fe8d571a475218fda7ffa5 (diff)
back to leads scheduler
-rwxr-xr-xindoteknik_custom/models/crm_lead.py9
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: