Skip to content

rlizana/oorq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RQ for OpenObject

Using python-rq for OpenObject tasks.

API compatibility

  • For OpenERP v5 the module versions are v1.X.X or below and branch is api_v5 Build Status
  • For OpenERP v6 the module versions are v2.X.X and branch is api_v6 Build Status
  • For OpenERP v7 the module versions are v3.X.X and branch is api_v7 Build Status

Example to do a async write.

Add the decorator to the function

from osv import osv
from oorq.decorators import job

class ResPartner(osv.osv):
    _name = 'res.partner'
    _inherit = 'res.partner'

    @job(async=True)
    def write(self, cursor, user, ids, vals, context=None):
        res = super(ResPartner,
                    self).write(cursor, user, ids, vals, context)
        return res

ResPartner()

Start the worker

$ PYTHONPATH=~/Projects/OpenERP/server/bin:~/Projects/OpenERP/server/bin/addons rqworker

Do fun things :)

About

OpenObject Redis Queue

Resources

Stars

Watchers

Forks

Packages

No packages published