summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/crm_lead.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-01-23 09:20:18 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-01-23 09:20:18 +0000
commitda5f5134f56b2ccf1c1de16c3f7616ab3719f3ea (patch)
treebc1bcb4fb00f2659be81810d528a9cf2cc6ce20d /indoteknik_custom/models/crm_lead.py
parente52cf84fd2284330412162b44066f29bd382f590 (diff)
parent8af5ee591aabc2d5d946c0eece93a5caab989975 (diff)
Merged in release (pull request #27)
Release
Diffstat (limited to 'indoteknik_custom/models/crm_lead.py')
-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: