Odoo Help

Welcome!

This community 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.

2

How to process event in Background, which is fired on pressing button ?

By
Mohit Chabdra
on 6/27/13, 10:05 AM 1,629 views

My problem is when i press button the openerp user interface is blocked, because it is doing some xmlrpc work, as long as work is in not done the openerp ui is blocked. So, my question is - Is there any way to do this work in background even i pressed the button ? I don`t want to use any scheduler or any server actions.

Also, I want to take care of repetitive xmlrpc events on pressing button 2-3 times.

Please suggest some thing , how to solve this problem ???

1

Stefan Reisich

--Stefan Reisich--
831
| 7 7 8
Pfungstadt, Germany
--Stefan Reisich--
Stefan Reisich
On 9/10/13, 10:34 AM

I found this at base/res/res_partner.py:

def email_send(self, cr, uid, ids, email_from, subject, body, on_error=''):
        while len(ids):
            self.pool.get('ir.cron').create(cr, uid, {
                'name': 'Send Partner Emails',
                'user_id': uid,
                'model': 'res.partner',
                'function': '_email_send',
                'args': repr([ids[:16], email_from, subject, body, on_error])
            })
            ids = ids[16:]
        return True

The task is added to the cron and executed as soon as possible(i think with a delay of max. a minute) in background.

Thanks , I already using cron jobs for doing background work in OpenERP, I think this is the only way to do it. anyways, thanks a lot.

Mohit Chabdra
on 9/13/13, 4:52 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/27/13, 10:05 AM
Seen: 1629 times
Last updated: 3/16/15, 8:10 AM