← Back to team overview

openerp-connector-community team mailing list archive

Re: Create a queue job with a custum function using the connector

 

On 02/18/2014 10:45 PM, El Hadji Dem wrote:
Hello Guys,

I created a custom function (get_all_documents(self, cr, uid, ids, context=None)).

This function connects to Alfresco and  creates documents in OpenERP with some criterias.

I use cmis to connect: it works fine.

I would like to add a `delay` attribute on the decorated function like in the connector.

Any ideas.

Merci,


EL HADJI DEM
Consultant DEVELOPPEUR OPENERP
http://www.savoirfairelinux.com
elhadji.dem@xxxxxxxxxxxxxxxxxxxx
Savoir-faire Linux Inc.
Tel: + 1 (514) 276 5468, ext. 137

7275 Saint-Urbain, bureau 200
Montréal, QC
H2R 2Y5

Savoir-faire Linux s'engage pour la formation continue et l'intégration des professionnels formés à l'étranger



Hi,

your function must respect this signature (for the 2 first parameters, then you can add your own parameters):

def my_function(session, model_name, ...):

my_function should be decorated with @job, see the documentation:
http://openerp-connector.com/api/api_queue.html#connector.queue.job.job

--
Guewen Baconnier
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 39
Office: +41 21 619 10 10
http://www.camptocamp.com/


References