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.

1

ODOO9: How to make a function called automatically!!

By
Drees Far
on 12/15/15, 6:48 AM 544 views

Hello!!

Friends, i have developped a function that works after clicking on a button.

But now i want my function working automatically without clicking on any button.

Does anyone have any suggestion please.

Thanks a lot in advance.

Best Regards.

0

Yenthe

--Yenthe--
6676
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 12/15/15, 7:05 AM

Hi Drees,

You'll need to create an automated action that calls a Python function every time the scheduler runs. An automated action example:

<record id="ir_cron_scheduler_demo_action" model="ir.cron"> <field name="name">Demo action</field> <field name="user_id" ref="base.user_root"/> <field name="interval_number">2</field> <field name="interval_type">minutes</field> <field name="numbercall">-1</field> <field eval="False" name="doall"/> <field eval="'Your.mode'" name="model"/> <field eval="'process_demo_scheduler_queue'" name="function"/> </record>

The Python code:

#This function is called when the scheduler goes off

def process_demo_scheduler_queue(self, cr, uid, context=None): #Your custom code here.

Yenthe

@Yenthe my friend, thanks a lot for your answer but i am working with odoo9 and i have got this error:TypeError: old_api() takes at least 4 arguments (3 given)

Drees Far
on 12/15/15, 8:50 AM

@Drees this should work fine on V9, this example is working on my V9 environments. Have a look at my example module, which you can find here: https://github.com/Yenthe666/Odoo_Samples/tree/master/scheduler_demo

Yenthe
on 12/15/15, 9:34 AM
0
Swapnesh
On 12/15/15, 11:15 AM

Hello Dress, 


You can also add functional filed in view so that each time your function will be called when view is opened.


Thanks

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: 12/15/15, 6:48 AM
Seen: 544 times
Last updated: 1/18/16, 3:23 PM