Odoo Help


1 Answer



| 6 3 9
Jakarta, Indonesia
08.09.14, 07:17

AFAIK, I don't think you can use ORM outside OpenERP without having to recreate the whole framework first.

What are you trying to achieve by accessing the ORM outside the framework?  Can it be performed within the framework instead?

09.09.14, 03:10

Hi ! I have a socket server that will receive asynchronous responses from a previous request made inside the ORM. I can handle the asynchronous response with XMLRPC, but the ORM beeing faster, that's why I would like to use it. And also, I'm curious to know why I can access the basic modules, and not the others. Oh, and the request being asynchronous, it cannot, of course, be handled inside the ORM.

09.09.14, 03:58

There are facilities such as Automated Actions and Scheduled Actions that can be used to perform asynchronous processes. As I mentioned, you need to recreate the supporting structure of the ORM first before using the ORM outside. OpenERP created a special namespace which is used for importing stuff within OpenERP. If you check the openerp/osv/orm.py file, on the top you'll find lines such as import openerp.netsvc, etc. So to use orm.py file, you need to have those files as well located at the path as specified (and so on, you need to trace the other imports that are needed by those imported files respectively). I haven't tried this, but maybe installing OpenERP using the binary package might help as if you install OpenERP using binary package, it will be stored within the PYTHON PATH.

10.09.14, 03:17

The python path isn't a problem, because I can include my addons folders in sys.path, then import a custom addon. However, that does not solve the problem, the pool does not contain the custom addon's objects.

11.09.14, 02:14

PY, sys.path is different from PYTHON PATH.

11.09.14, 03:36

I think I understand a little better. I think it's the instanciation of the pool that the addons must be added, but how, I will need to find out. (On a side note, I already now how to fix my code with xmlrpclib, so from this point, this question is just curiosity ^^)

11.09.14, 03:46

Congratulation PY. It would be great if you can share what you have learned with all of us. And yes, the instanciation of the objects in addons and especially base must be proper to create a proper OpenERP environment.

11.09.14, 04:52

Pfff, this is a mess... I've been reading the code for more than an hour now, and I think I will pass for today ^^ I've learned a lot, but not enough. However, I will accept your answer, since it's not so easy to do it. People (including me) would be better served with xmlrpc. Thanks anyway !

Ask a Question
Keep Informed
1 follower(s)
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