Odoo Help


Adding a scheduled action

on 3/27/15, 10:56 AM 1,320 views

So I want a scheduled action that sends out the payment follow-ups. I'm using the standard module for this.

I've gone to Scheduled Actions and added a new one, the module is: account_followup_print and the method do_process.

Yet this is not yielding any results, no mails are being sent (when I do it manually it sends out 30 ish), when I check the terminal it's not even doing anything at the time it's supposed to send it out.

Any insights? Thanks !

EDIT: I've also tried adding it directly to the code without success:



<record forcecreate="True" id="ir_cron_project_task" model="ir.cron">

<field name="name">Run Payment Follow-up scheduler</field>

<field eval="True" name="active"/>

<field name="user_id" ref="base.user_root"/>

<field name="interval_number">1</field>

<field name="interval_type">minutes</field>

<field name="numbercall">-1</field>

<field eval="False" name="doall"/>

<field eval="'account_followup.print'" name="model"/>

<field eval="'do_process'" name="function"/>




@zbik: if I use your code I get the following error message:

Error while evaluating condition '_add_missing_default_values': name '_add_missing_default_values' is not defined



| 6 5 7
Lodz, Poland

On 3/28/15, 10:10 AM

Method do_process() is not implemented as cron method. Cron method looks like this:

run_scheduler(self, cr, uid, context=None): 

but parameters do_process():

do_process(self, cr, uid, ids, context=None):

You must inherit model account_followup_print and implement run_scheduler() method like this:

from openerp import models, fields, api, _
import time
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
class account_followup_print(models.TransientModel):
   _inherit = 'account_followup.print'
   def run_scheduler(self, cr, uid, context=None):
         current_date = time.strftime(DEFAULT_SERVER_DATE_FORMAT)
         if context is None:
            context = {}
         vals = {}
         vals['date'] = current_date
         id = super(account_followup_print, self).create(cr, uid, vals, context=context)
         return super(account_followup_print, self).do_process(cr, uid, [id], context=context)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/27/15, 10:56 AM
Seen: 1320 times
Last updated: 3/28/15, 3:42 PM