Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

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
Buang

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

Penulis

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

Penulis

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

Penulis

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.

Post Terkait Replies Tampilan Aktivitas
1
Okt 19
4498
0
Apr 24
1323
2
Agu 24
1638
0
Des 22
2798
1
Jul 17
3608