From 41547d5942d1a945a7cb8af9b8434c8161f9e28a Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Mon, 25 Jun 2012 11:43:43 +0530 Subject: [PATCH 1/4] [IMP]customers-sales-receipt bzr revid: pja@tinyerp.com-20120625061343-oxbyvom0a37qtcez --- addons/account_voucher/voucher_sales_purchase_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 5de7636c0c1..1365a24051f 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -96,15 +96,15 @@ + - - + From f1957e856384abfaba18bf82750e7daee19e5f02 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Mon, 25 Jun 2012 11:59:19 +0530 Subject: [PATCH 2/4] [IMP]customers-sales-receipt bzr revid: pja@tinyerp.com-20120625062919-lawo5zyr8i4zn8jc --- addons/account_voucher/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 9ca30aed099..1e882b7c585 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -260,7 +260,7 @@ class account_voucher(osv.osv): ('receipt','Receipt'), ],'Default Type', readonly=True, states={'draft':[('readonly',False)]}), 'name':fields.char('Memo', size=256, readonly=True, states={'draft':[('readonly',False)]}), - 'date':fields.date('Date', readonly=True, select=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"), + 'date':fields.date('Bill Date', readonly=True, select=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"), 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'line_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=True, states={'draft':[('readonly',False)]}), From 5fabd6fe48ef3d76892d8c09b197cebf4d520045 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Wed, 27 Jun 2012 10:32:16 +0530 Subject: [PATCH 3/4] [IMP] improve sales-receipt bzr revid: pja@tinyerp.com-20120627050216-lf9nko3d1q3vqdj9 --- addons/account_voucher/account_voucher.py | 16 +++++++++++++--- .../voucher_sales_purchase_view.xml | 4 +++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 1e882b7c585..1eba8c5be9a 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -52,7 +52,16 @@ class account_voucher(osv.osv): paid = True res[voucher.id] = paid return res - + def untaxed_amount(self, cr, uid, ids, name, args, context=None): + res = {} + amount = 0.0 + for voucher in self.browse(cr, uid, ids, context=context): + for line in voucher.line_cr_ids: + amount += line.amount + res[voucher.id] = amount + return res + + def _get_type(self, cr, uid, context=None): if context is None: context = {} @@ -312,6 +321,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_untaxed': fields.function(untaxed_amount, digits_compute=dp.get_precision('Account'), string='Untaxed'), } _defaults = { 'period_id': _get_period, @@ -381,6 +391,7 @@ class account_voucher(osv.osv): return True def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context=None): + context = context or {} tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') @@ -398,7 +409,6 @@ class account_voucher(osv.osv): line_amount = 0.0 line_amount = line.get('amount',0.0) voucher_total += line_amount - total = voucher_total total_tax = 0.0 if tax_id: @@ -415,7 +425,7 @@ class account_voucher(osv.osv): res.update({ 'amount':total or voucher_total, - 'tax_amount':total_tax + 'tax_amount':total_tax }) return { 'value':res diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 1365a24051f..0cb24c6d7e5 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -131,11 +131,12 @@ + - +