Odoo Help

0

0
1 Answer
1
Avatar

Ivan

--Ivan--

3400
| 5 3 8
Jakarta, Indonesia
--Ivan--
Ivan
9/8/14, 7:17 AM

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?

7 Comments
PY
9/9/14, 3:10 AM

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.

Ivan
9/9/14, 3:58 AM

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.

PY
9/10/14, 3:17 AM

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.

Ivan
9/11/14, 2:14 AM

PY, sys.path is different from PYTHON PATH.

PY
9/11/14, 3:36 AM

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 ^^)

Ivan
9/11/14, 3:46 AM

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.

PY
9/11/14, 4:52 AM

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
Writer
549
PY
Tags
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.

Register
Odoo Training Center

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

Test it now