Hello everyone,
I wrote a Scheduler actions like below, but not working...
in crm_lead.py
def compute_lead_type(self, cr, uid, ids, name, args, context=None):
for record in self.browse(cr, uid, ids, context=context):
lead_type=record.type
lead_id=record.id
if lead_type=='lead': # Checks the lead ID is converted to opportunity or not
lead_crm_phonecall_id = self.pool.get('crm.phonecall').search(cr, uid, [('opportunity_id', '=', lead_id)], context=context) # Checks the lead is scheduled or not
if lead_crm_phonecall_id: # Checks the lead ID is available or not in crm.phonecall
message_text='This Lead is scheduled'
else:
message_text='This Lead is Not scheduled'
message = _('Hello this is testing')
self.message_post(cr, uid, [lead_id], message, context=context)
return
in crm_lead_view.xml
<record forcecreate="True" id="ir_cron_scheduler_checking_lead"
model="ir.cron">
<field name="name">Checking status of lead</field>
<field eval="True" name="active" />
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
<field eval="'crm.lead'" name="model" />
<field eval="'compute_lead_type'" name="function" />
<field eval="'()'" name="args" />
</record>
This is not working, please help me,
thanks in advance...
i am using v7