Odoo Help


How to call Create Method from another method??

on 10/27/16, 1:43 AM 266 views

How to call a create method from other methods.

@api.model def process_demo_scheduler_queue(self):
        print "at the top"

        print "at bottom"


@api.model def test1(self,vals):
        print "ki"

       attachment = super(scheduler_demo, self).create(vals)

       print attachment

       return attachment

This code not working. Any help??

ayman mohammed adam
On 10/27/16, 1:54 AM

dear Annadurai,

if you need to call create method within a same model just you can use :


vals is a dictionary have keys and values for required fields at least like this:
vals= {'field1':value, 'field2': value}

if you need to call create method from another model just you must declare object with this model and call create method like this:

model2_obj= self.env['model2.model2']

 I hope i helped you....

Thank you Ayam

on 10/27/16, 1:57 AM


ayman mohammed adam
on 10/27/16, 2:02 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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/27/16, 1:43 AM
Seen: 266 times
Last updated: 10/27/16, 1:56 AM