Contributors mailing list archives

contributors@odoo-community.org

Avatar

Re: Overwriting a method in OCA module.

by
Open Architects Consulting, Houssine BAKKALI
- 11/09/2015 13:25:43
as far as you doesn't break the inheritance mechanism it's ok. You just have to be sure that the method that you're overwriting doesn't call a super method doing some business logic. In that case overwriting become tricky...

2015-09-11 12:08 GMT+02:00 Kitti U. <kittiu@ecosoft.co.th>:
Dear Contributors,

(not sure this kind of question should be here, on in PR, please let me know).

Generally, when we develop OCA modules.

In coding, when we inherit a class form Odoo. But found no way to inherit method, super(model, self)._method(), and the only way to do is to Overwrite a method completely. 

For example, in account_voucher.recompute_voucher_lines(). This is a lengthy function which make it difficult to hook it with my code. The only way to do is overwriting it.

Is overwriting a method allowed, or how you guys cope with it when it happen?

Thank you,
--
Mobile: +66-(0)8-1841-7480
Your ERP Partner => www.ecosoft.co.th

_______________________________________________
Mailing-List: http://odoo-community.org/groups/oca-contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


Reference