From 30f07ee98d5b6b6f4738a33562696ce8cc2aff33 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 24 Jul 2013 11:40:23 +0200 Subject: [PATCH] [FIX] account_voucher: better voucher payment screen revert commit 9310 with incorrect writeoff amount hide writeoff reconcilation fields when no price difference hide analytic_id (Write-Off Analytic Account) when not with_writeoff bzr revid: mat@openerp.com-20130724094023-fbd1hqwe9hdh28id --- addons/account_voucher/account_voucher.py | 6 ++---- .../voucher_payment_receipt_view.xml | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index e39ebf99d4f..d9a3fefbd6a 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -236,9 +236,9 @@ class account_voucher(osv.osv): debit = credit = 0.0 sign = type == 'payment' and -1 or 1 for l in line_dr_ids: - debit += l['amount_unreconciled'] + debit += l['amount'] for l in line_cr_ids: - credit += l['amount_unreconciled'] + credit += l['amount'] return amount - sign * (credit - debit) def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_currency, type, context=None): @@ -1298,10 +1298,8 @@ class account_voucher(osv.osv): } new_id = move_line_obj.create(cr, uid, move_line_foreign_currency, context=context) rec_ids.append(new_id) - if line.move_line_id.id: rec_lst_ids.append(rec_ids) - return (tot_line, rec_lst_ids) def writeoff_move_line_get(self, cr, uid, voucher_id, line_total, move_id, name, company_currency, current_currency, context=None): diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index dea94d59f4e..5d259772363 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -332,14 +332,15 @@ - + + attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/> + groups="analytic.group_analytic_accounting" + attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/> @@ -494,14 +495,15 @@ - + + attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/> + groups="analytic.group_analytic_accounting" + attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>