Contributors mailing list archives
Re: Overwriting a method in OCA module.by
To preserve any existing inheritance, you could in such a module replace
the original method with the refactored version by applying it as a
monkeypatch in _register_hook. While it will still affect all databases
on the instance once the module is installed, it will not be preloaded
if the module is only in the module path and not installed on any
database. That trick is courtesy of Holger Brunn, BTW.
On 16-09-15 21:22, Nhomar Hernandez wrote:<blockquote cite="mid:CAKtu5Y7J6vm05QTSsCzWxbK=ksptf8yWYF=-BD4UmLUO-Z=DBg@mail.gmail.com" type="cite">On Wed, Sep 16, 2015 at 7:53 AM, Kitti U. <firstname.lastname@example.org> wrote:(i.e., account_voucher_monkeypatch)no **_monkeypatch on the name, a name that mention the monkeypatched method is more ellegant.I think it should be in a "Good Practice technique section".
+1-- Opener B.V. - Business solutions driven by open source collaboration Stefan Rijnhart - Consultant/developer mail: email@example.com tel: +31 (0) 20 3090 139 web: https://opener.am
Post to: mailto:firstname.lastname@example.org