Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty

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
Hylkää

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...

Tekijä

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 ...

Tekijä

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

Tekijä

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.

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
lokak. 19
4498
0
huhtik. 24
1323
2
elok. 24
1638
0
jouluk. 22
2798
1
heinäk. 17
3608