Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to set process in subscription module in openerp?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 359
    Comment on it

    To set process in subscription module, first you need to install subscription module and set interval number and interval type fields in subscription module is used to set the process. You can use this function as given below

    def process(self, cr, uid, ids, context=None):
            for row in self.read(cr, uid, ids, context=context):
                mapping = {'name':'name','interval_number':'interval_number','interval_type':'interval_type','exec_init':'numbercall','date_init':'nextcall'}
                res = {'model':'subscription.subscription', 'args': repr([[row['id']]]), 'function':'model_copy', 'priority':6, 'user_id':row['user_id'] and row['user_id'][0]}
                for key,value in mapping.items():
                    res[value] = row[key]
                id = self.pool.get('ir.cron').create(cr, uid, res)
                self.write(cr, uid, [row['id']], {'cron_id':id, 'state':'running'})
            return True
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: