Community mailing list archives


Re: Edit in orm

Numa Extreme Systems, Gustavo Marino
- 01/20/2015 13:33:22
Just use monkey-patching
Let say

from openerp import models

old_fields_get = models.Model.fields_get
def new_fields_get(self):

models.Model.fields_get = new_fields_get

Be careful: due to a questionable design decision, once you put your module in the addons path, it will be loaded EVEN IF IT IS NOT INSTALLED (see web initialization, every module is loaded at the very beginning). So, if your module is not prepared to be called even when not installed you will get very strange consequences, and given the fact the orm is used to initiallly load all modules, it could lead to a not usable system

If you are careful, it will work

Gustavo Adrian Marino


Mobile:  +54 911 5498 2515


Skype: gustavo.adrian.marino


<img border="0" width="213" height="94" src="cid:image001.jpg@01CC37F5.99B4CD20" alt="Descripción: Numa Logo V 1-0">

2015-01-20 15:18 GMT-03:00 Denis Karataev <>:
By the way, once I've faced with similar problem. I wanted to rewrite the "unlink" method for all objects to inject some additional behavior there. Could anyone recommend how to do it? Thanks

2015-01-20 20:23 GMT+03:00 Mohamed Magdy <>:
I think all you need is to override the orm class

Best Regards,

Mohamed Magdy
Mob: +201114347478

On Tue, Jan 20, 2015 at 3:23 PM, Mohamed Mtloob <> wrote:
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

Post to:

Post to:

Denis Karataev
CEO at Transparent Technologies

Post to: