Contributors mailing list archives
Re: Overwriting a method in OCA module.by
Opener B.V., Stefan Rijnhart
On 28-09-15 05:23, Kitti U. wrote:<blockquote cite="mid:CAKNFPG7XQUWFVLVSNc0eJkxPvFZo5ca2ke=d1_1KEBAB=h4uSA@mail.gmail.com" type="cite">
I have tested the monkey patch for account_billing module, which will PR to account-payment.
However, I follow the example here using _register_hook from https://github.com/Therp/Therp-Addons/blob/7.0/mail_error/model/mail_mail_monkeypatch.py
It doesn't work. The expected overwritten method in account_voucher_hook_recompute_vline.py
is not being called ???
Hi Kitti U.,
I had to look twice myself, but with this change it works:
@@ -19,7 +19,7 @@
from openerp import models
-from openerp.addons.account_voucher import account_voucher
+from openerp.addons.account_voucher.account_voucher import account_voucher
def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
You were importing the account_voucher.py, but we want the account_voucher object in this file.
-- Opener B.V. - Business solutions driven by open source collaboration Stefan Rijnhart - Consultant/developer mail: firstname.lastname@example.org tel: +31 (0) 20 3090 139 web: https://opener.am