Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.2 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.2 KB

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 rq worker

Do fun things :)