From 87a3464329fa55562d765c79cc006ff1f360f4c6 Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Sat, 10 Nov 2012 19:01:29 +0100 Subject: [PATCH] [IMP] Added onchange methods in account_voucher.account_bank_statement_line for parent_id and amount in order to set the voucher_id to False. bzr revid: vta@openerp.com-20121110180129-ww29a3ciuo90iop5 --- addons/account_voucher/account_voucher.py | 8 ++++++++ addons/account_voucher/account_voucher_view.xml | 3 +++ 2 files changed, 11 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 061a213d8d0..cf2c25e3e5f 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1557,6 +1557,14 @@ account_bank_statement() class account_bank_statement_line(osv.osv): _inherit = 'account.bank.statement.line' + def onchange_partner_id(self, cr, uid, ids, partner_id, context=None): + res = super(account_bank_statement_line, self).onchange_partner_id(cr, uid, ids, partner_id, context=context) + res['value'].update({'voucher_id' : False}) + return res + + def onchange_amount(self, cr, uid, ids, amount, context=None): + return {'value' : {'voucher_id' : False}} + def _amount_reconciled(self, cursor, user, ids, name, args, context=None): if not ids: return {} diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 0bed5793587..7460feada15 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -225,6 +225,9 @@ + + onchange_amount(amount) +