Skip to Content
Menú
This question has been flagged

Hi,

I'm developing for Odoo version 8 in Ubuntu, and I have realized that the modules included in Odoo, e.g website_sale, incorporate models whose source code uses the OpenERP v7 API.

I think that it is not good for developers because if I needed to study the source code from models included in Odoo v8, I would have to learn the OpenERP v7 API, apart from the Odoo v8 API.

Why aren't modules included in Odoo8 by default implemented using the Odoo v8 API?.

Thanks.

Avatar
Descartar

Hi, New module are in new API. Some module are migrate when a refactor to improve code are done... Others modules are migrate one by one...

Autor

Thanks for your answer Jérémy. What modules are new in Odoo 8?. I had been watching the models source code from crm, calendar and hr modules, but I think that they are still using the old API.

Hi, you can grep "from openerp import.*api" to find python file using new api (full or partially). Else, module like event eg are already migrate in new api ...

Autor

Sorry for my inexperienced, but I suppose you wanted to write down "from openerp import api", didn't you?. I'm using this import in Pycharm IDE, but after this I don't know what I must do to see what modules are implemented in new Odoo api. The PyCharm autocompletation doesn't show any clue about this.

Hi, that was a regexp to match import like "from openerp import models, fields, api, _" But If you want to learn the new API I suggest you to read the documentation https://www.odoo.com/documentation/8.0/howtos/backend.html And if you want to read a real module, take a look in addons/event/event.py

Autor

If I write down in a .py file from an Odoo project the import "from openerp import.*api", PyCharm IDE gives me an error. Instead, with the import "from openerp import models, fields, api, _" no errors occur.

Related Posts Respostes Vistes Activitat
1
d’oct. 19
4496
0
d’abr. 24
1323
2
d’ag. 24
1638
0
de des. 22
2797
1
de jul. 17
3608