Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: Overwriting a method in OCA module.
by
Vauxoo, Moisés López Calderón
Kitti U
Can you add a PR to https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md with conclusion, please?2015-09-12 9:08 GMT-05:00 Levent Karakas <levent@mektup.at>:
An example for nhomar's proposal is Juan's account_voucher_payline module which is used by account_check and account_voucher_withholding modules.2015-09-12 1:37 GMT+03:00 Nhomar Hernandez <nhomar@vauxoo.com>: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 HernandezCEO Vauxoo.Site: http://vauxoo.comTwitter: @nhomarBlog: http://geronimo.com.veLPUser: http://launchpad.net/~nhomarOdoo Gold Partner_______________________________________________
Mailing-List: http://odoo-community.org/groups/oca-contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe_______________________________________________
Mailing-List: http://odoo-community.org/groups/oca-contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe
--
Moisés López Calderón
Vauxoo - OpenERP's Gold Partner
Mobile: (+521) 477-752-22-30
Office: (+52) 477-773-33-46
web: http://www.vauxoo.com
Vauxoo - OpenERP's Gold Partner
Mobile: (+521) 477-752-22-30
Office: (+52) 477-773-33-46
web: http://www.vauxoo.com
twitter: @vauxoo
@moylop260
hangout: moylop260@vauxoo.com
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