Odoo Help

Welcome!

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

0

Edit in fields_view_get in Orm class

By
Mohamed Mtloob
on 1/20/15, 8:25 AM 480 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

--

Thanks
Mohamed Mtloob

Sr.Odoo Developer @ Techorg CO
Linkedin

0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
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

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

Thanks

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.

Ivan
on 1/20/15, 11:05 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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