Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: Overwriting a method in OCA module.
by
Vauxoo, Nhomar Hernández
On Fri, Sep 11, 2015 at 5:08 AM, Kitti U. <kittiu@ecosoft.co.th> wrote:
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.
Hello.
What you should is (in order to propose a correct approach in a communitary way).
1.- Overwrite the method in a module which split (refactoring it) the mega method in several mini methods and/or hooks. (this is module1 and propose to OCA explaining why for stable-version).
2.- MAke the change on master or future version on core (just to ensure in future this will not be necesary or prepare yourself for the future).
3.- Then make your module2 dependant of module 1 to ensure your specific approach using your new algorithm.
Obviously this is a little more complex to manage and/or support but it left your set of changes ready for future and ready for deprecate the non-correct way of things due to incorrect base designs.
We on this specific model (account_voucher) overwrite a lot of things because as you said it is a really ugly / dirty method.
For v9 account_voucher is being less used (I am not agreed but it will) and then may be make a huge effort with step 2 is not necesary.
Regards.
--
Nhomar Hernandez
CEO Vauxoo.
Site: http://vauxoo.com
Twitter: @nhomar
Blog: http://geronimo.com.ve
LPUser: http://launchpad.net/~nhomar
Odoo Gold Partner
Móvil Venezuela:
+58 4144110269
+58 4144110269
Móvil México:
+52 1 4773933942
+52 1 4773933942
Reference
-
Overwriting a method in OCA module.
by "Kitti U." <kittiu@ecosoft.co.th> - 11/09/2015 11:56:28 - 0-
Re: Overwriting a method in OCA module.
byEcosoft Co. Ltd., Kitti Upariphutthiphong -
Re: Overwriting a method in OCA module.
byEcosoft Co. Ltd., Kitti Upariphutthiphong -
Re: Overwriting a method in OCA module.
by "Kitti U." <kittiu@ecosoft.co.th> - 16/09/2015 14:44:11 - 0