From cd8641a2284f2207ea404e3c9e50145c08316f8d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 21 Oct 2011 17:47:04 +0200 Subject: [PATCH] [FIX] account_voucher: do not let the field payment_rate editable if the voucher is posted + [FIX] onchange_journal do not reset the amount to 0 anymore bzr revid: qdp-launchpad@openerp.com-20111021154704-r7bi9a7iqpxaccem --- addons/account_voucher/account_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 20eb552c074..03b3a75144c 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -247,7 +247,7 @@ class account_voucher(osv.osv): 'comment': fields.char('Counterpart Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), 'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), 'writeoff_amount': fields.function(_get_writeoff_amount, string='Reconcile Amount', type='float', readonly=True), - 'payment_rate': fields.float('Payment Rate', digits=(12,6), required=True, + 'payment_rate': fields.float('Payment Rate', digits=(12,6), required=True, readonly=True, states={'draft': [('readonly', False)]}, help='The rate between the journal currency and the company currency for this particular payment.'), 'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True), } @@ -616,7 +616,7 @@ class account_voucher(osv.osv): tax_id = account_id.tax_ids[0].id vals = self.onchange_price(cr, uid, ids, line_ids, tax_id, partner_id, context) - vals['value'].update({'tax_id':tax_id}) + vals['value'].update({'tax_id':tax_id,'amount': amount}) currency_id = False if journal.currency: currency_id = journal.currency.id