Contributors mailing list archives

contributors@odoo-community.org

Re: Overwriting a method in OCA module.

by
Therp, Ronald Portier
- 11/09/2015 15:10:59
IMHO I think it is good to avoid complete overrides where possible.

However, due to the general lack of modularity and extendability of many
Odoo methods this can not always be avoided.

And PR's to improve the Odoo standard code can take a really long time
to be taken up by Odoo. If they will accept them anyway.

Kind regards, Ronald


Op 11-09-15 om 15:37 schreef Mignon, Laurent:
> IMO, we should disallow this kind of 'full' override without call to
> super. This kind of override breaks the inheritance chains. Since we
> don't have the control on the order in which the inheritance chain is
> build by odoo when two modules extends the same one, this kind of
> override will silently break some functionalities. IMO it's better to
> make a PR to Odoo to improve the modularity of the method to extend an
> base the new method on this PR. 
> 
> On Fri, Sep 11, 2015 at 1:38 PM, Lionel Sausin <ls@numerigraphe.com
> <mailto:ls@numerigraphe.com>> wrote:
> 
>     If you have no other choice it's better that nothing I guess.
>     Please take care to clearly indicate why you are doing this in the code 
>     comments of your module, and explain in the README that your module is 
>     incompatible with other modules which change the same method.
>     Ideally, you could also make a PR for Odoo master to add the "hooks" you 
>     miss, so that in the next version you remove the limitation from your 
>     module.
> 
> 
>     _______________________________________________
>     Mailing-List: http://odoo-community.org/groups/oca-contributors-15
>     Post to: mailto:contributors@odoo-community.org
>     <mailto:contributors@odoo-community.org>
>     Unsubscribe: http://odoo-community.org/groups?unsubscribe
> 
> 
> 
> 
> -- 
> *Laurent Mignon*
> Senior software engineer
> 
> Tel: +352 20 21 10 20 32
> Fax: +352 20 21 10 21
> Email: laurent.mignon@acsone.eu <mailto:laurent.mignon@acsone.eu>
> 
> Acsone SA, Succursale de Luxembourg 
> 22, Zone Industrielle
> ​ ​
> ​| L-8287 Kehlen, Luxembourg
> TVA LU24733605
> ​ | ​RCS B160400​
> 
> ​
> Acsone sa/nv
> Boulevard de la Woluwe 56, b4  Woluwedal
> ​ | B-1200 Bruxelles - Brussel 
> RPM Bruxelles 0835.207.216 RPR Brussel  
> 
> www.acsone.eu 
> 
> 
> _______________________________________________
> Mailing-List: http://odoo-community.org/groups/oca-contributors-15
> Post to: mailto:contributors@odoo-community.org
> Unsubscribe: http://odoo-community.org/groups?unsubscribe
>