From 37dc334f0c32cbccf44a5d555982b3300ca01776 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Mon, 25 Jun 2012 19:07:05 +0530 Subject: [PATCH 1/3] [IMP] improve the supplier payment and write check view. bzr revid: nco@tinyerp.com-20120625133705-z4v609vb7wkr46ta --- .../account_voucher_view.xml | 146 +++++++++++++++++- addons/account_voucher/account_voucher.py | 14 +- .../voucher_payment_receipt_view.xml | 11 +- 3 files changed, 161 insertions(+), 10 deletions(-) diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml index b53bdc35468..7573218229f 100644 --- a/addons/account_check_writing/account_voucher_view.xml +++ b/addons/account_check_writing/account_voucher_view.xml @@ -2,14 +2,12 @@ - - - - account.voucher.payment.check.form - account.voucher - form - + + + + + + + + account.voucher.payment.check.form + account.voucher + form + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 9ca30aed099..f7f18f89d3e 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -247,7 +247,18 @@ class account_voucher(osv.osv): rate = voucher_rate * company_currency_rate res[voucher.id] = voucher.amount / rate return res - + def _amount_all(self, cr, uid, ids, name, args, context=None): + print ids, "\n name ",name, "\n args ::> ", args, "\n context ::> ",context + res = {} + amount = 0.0 + for voucher in self.browse(cr, uid, ids, context=context): + print "voucher :> ",voucher + for line in voucher.line_dr_ids: + print "line :> ",line + amount += line.amount + print "amount ::>> ",amount + res[voucher.id] = amount + return res _name = 'account.voucher' _description = 'Accounting Voucher' _order = "date desc, id desc" @@ -312,6 +323,7 @@ class account_voucher(osv.osv): help='The specific rate that will be used, in this voucher, between the selected currency (in \'Payment Rate Currency\' field) and the voucher currency.'), 'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True), 'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'), + 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Invoice Total'), } _defaults = { 'period_id': _get_period, diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index cfed906e431..ac3bbe93fbb 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -150,8 +150,10 @@ - - +

+ +

+ + + + @@ -228,7 +233,9 @@ + + From 20a04f01de32be4bb203275b2504c5cf11c71a34 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Tue, 26 Jun 2012 11:11:14 +0530 Subject: [PATCH 2/3] [IMP] improve view for supplier payment and write checks. bzr revid: nco@tinyerp.com-20120626054114-nh23jv8dyu98areu --- addons/account_check_writing/account_voucher_view.xml | 7 +++---- addons/account_voucher/account_voucher.py | 8 ++------ addons/account_voucher/voucher_payment_receipt_view.xml | 4 ++-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml index 7573218229f..d52a595796e 100644 --- a/addons/account_check_writing/account_voucher_view.xml +++ b/addons/account_check_writing/account_voucher_view.xml @@ -96,9 +96,9 @@ - - - + + + @@ -154,7 +154,6 @@
-
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f7f18f89d3e..21b0a785da6 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -247,16 +247,12 @@ class account_voucher(osv.osv): rate = voucher_rate * company_currency_rate res[voucher.id] = voucher.amount / rate return res - def _amount_all(self, cr, uid, ids, name, args, context=None): - print ids, "\n name ",name, "\n args ::> ", args, "\n context ::> ",context + def _amount_total(self, cr, uid, ids, name, args, context=None): res = {} amount = 0.0 for voucher in self.browse(cr, uid, ids, context=context): - print "voucher :> ",voucher for line in voucher.line_dr_ids: - print "line :> ",line amount += line.amount - print "amount ::>> ",amount res[voucher.id] = amount return res _name = 'account.voucher' @@ -323,7 +319,7 @@ class account_voucher(osv.osv): help='The specific rate that will be used, in this voucher, between the selected currency (in \'Payment Rate Currency\' field) and the voucher currency.'), 'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True), 'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'), - 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Invoice Total'), + 'amount_line_total': fields.function(_amount_total, digits_compute=dp.get_precision('Account'), string='Invoice Total'), } _defaults = { 'period_id': _get_period, diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index ac3bbe93fbb..49e989aac00 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -206,8 +206,8 @@ - - + + From 6ecc7cc97e31d4a38a6cc12195acb1966b3dc423 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Tue, 26 Jun 2012 15:35:39 +0530 Subject: [PATCH 3/3] [IMP] improve the supplier payment and write check view. bzr revid: nco@tinyerp.com-20120626100539-nu49v8dttvjs5r3t --- .../account_voucher_view.xml | 34 ++++++------------- .../voucher_payment_receipt_view.xml | 22 +++++++----- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml index d52a595796e..8805bc4603b 100644 --- a/addons/account_check_writing/account_voucher_view.xml +++ b/addons/account_check_writing/account_voucher_view.xml @@ -2,28 +2,7 @@ - - - - - + account.voucher.payment.check.form @@ -48,8 +27,15 @@ widget="selection" on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, company_id, context)" string="Payment Method"/> - - + + + + diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 49e989aac00..03cee6d6a14 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -150,17 +150,23 @@ +