Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3613 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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

Tác giả

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

Tác giả

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

Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 19
4499
0
thg 4 24
1323
2
thg 8 24
1638
0
thg 12 22
2800
1
thg 7 17
3608