Odoo Help


Edit in fields_view_get in Orm class

Mohamed Mtloob
on 1/20/15, 8:25 AM 883 views

Dear All

Hope my mail find you well
Could you help me about now i made updates in fields_view_get the main method in orm class

my question is how to separate my customized code in separate module??? ...
when installed it my customized code is installed


Mohamed Mtloob

Sr.Odoo Developer @ Techorg CO




| 5 3 6
Jakarta, Indonesia
On 1/20/15, 8:33 AM

It is similar with other python inheritance.  You define the fields_view_get method of the model in a new module.  If you still need to call the super method, you call it by res = super(class_name, self).fields_view_get(....).  You can then put you logic before or after the super call and return res or an modified res.  A sample could be found in addons/account/account.py

Mohamed Mtloob
On 1/20/15, 8:40 AM

thank you Ivan for your quicly respond

i know what you say about how to _inherit fields_view_get for one module

my question is about "i update in orm class itself openerp core module "in fields_view_get method under basemodel class for all objects in openerp.

how these updates can be seperated in module installble ??

hope you understand me...


Please avoid editing in the orm models it may lead to crash the module, I think it cant be separated bcoz u changed in the orm models.

Umashankar Subramani
on 1/20/15, 9:04 AM

sir .. why i can't update and change in orm class while i understand every line in it and my business need to change it.. i updated it and no error for all modules.. i need to seperate theses updates in seperated installed module.. How ???

Mohamed Mtloob
on 1/20/15, 9:23 AM

There have been numerous questions in this forum that discusses that topic. One is this: https://www.odoo.com/forum/help-1/question/how-to-override-basemodel-or-model-class-of-orm-py-36517. One of the disadvantages of doing this is that you are breaking the upgrade path, i.e. whatever update to that method made by the official trunk will not be reflected because it will be your custom code that runs.

on 1/20/15, 11:05 PM

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.


Odoo Training Center

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

Test it now

Question tools

1 follower(s)


Asked: 1/20/15, 8:25 AM
Seen: 883 times
Last updated: 3/16/15, 8:10 AM