From 2c76ea931b447279e239c84d58478876df865026 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 27 Jan 2009 15:08:30 +0530 Subject: [PATCH 1/7] Set FormatLang Function In : account/project/report/analytic_balance.rml account/project/report/quantity_cost_ledger.rml account/project/report/quantity_cost_ledger.sxw bzr revid: apa@tinyerp.com-20090127093830-66flw75wdlg0hnr0 --- .../project/report/analytic_balance.rml | 24 +- .../project/report/quantity_cost_ledger.rml | 266 +++++++++--------- 2 files changed, 140 insertions(+), 150 deletions(-) diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 0d1c7d53ad1..598937b29aa 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -128,16 +128,16 @@ - [[ sum_debit(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ sum_credit(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ sum_balance(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ sum_quantity(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]] @@ -153,16 +153,16 @@ [[ o.complete_name ]] - [[ move_sum_debit(o.id,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(move_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ move_sum_credit(o.id,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(move_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ move_sum_balance(o.id,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(move_sum_balance(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ move_sum_quantity(o.id,data['form']['date1'],data['form']['date2']) or '0.0']] + [[ formatLang(move_sum_quantity(o.id,data['form']['date1'],data['form']['date2'])) ]] @@ -174,16 +174,16 @@ [[ move_g['name'] ]] - [[ move_g['debit'] or '0.0']] + [[ formatLang(move_g['debit'])]] - [[ move_g['credit'] or '0.0']] + [[ formatLang(move_g['credit']) ]] - [[ move_g['balance'] or '0.0']] + [[ formatLang(move_g['balance'])]] - [[ (move_g['quantity'] or '0.0') ]] + [[ formatLang(move_g['quantity']) ]] diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml index 42fb7330a07..5c7e9331078 100644 --- a/addons/account/project/report/quantity_cost_ledger.rml +++ b/addons/account/project/report/quantity_cost_ledger.rml @@ -3,30 +3,6 @@ @@ -69,7 +45,10 @@ - + + + + @@ -78,29 +57,28 @@ - - - + + + + - - + + - - @@ -114,13 +92,13 @@ - + - - + + @@ -132,30 +110,30 @@ - - - - - - + + + + - + @@ -181,13 +159,13 @@ - [[ data['form']['date1'] ]] + [[ formatLang(data['form']['date1'],date = True) ]] - [[ data['form']['date2'] ]] + [[ formatLang(data['form']['date2'],date = True) ]] - [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + [[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]] @@ -197,11 +175,10 @@ -
- + - Code/Date + Code/Date J.C./Move name @@ -213,92 +190,105 @@ Total - - - - - - - Total: - - - - - - [[ '%.2f' % (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0) ]] - - - - - - + + + + + - - [[ repeatIn(objects,'o') ]] - - - - [[ o.code ]] - - - [[ o.complete_name ]] - - - Max.qty:[[ '%.2f' % (o.quantity_max or 0.0)]] - - - [[ '%.2f' % (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0 )]] - - - - - - [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]] - - - - [[ move_g['code'] ]] - - - [[ move_g['name'] ]] - - - - - - - - [[ '%.2f' % (move_g['quantity'] or 0.0) ]] - - - - - - - - - [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]][[ move_a['date'] ]] - - - [[ move_a['cj'] ]] / [[ move_a['name'] ]] - - - [[ '%.2f' % (move_a['quantity'] or 0.0 )]] - - - - - - - - - - - - - - - + + Total: + + + + + + + + + + + + + [[ formatLang (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) ) ]] + + + + + + +
+ [[ repeatIn(objects,'o') ]] + + + + + + + [[ o.code ]] + + + [[ o.complete_name ]] + + + Max Qty: [[ formatLang (o.quantity_max )]] + + + [[ formatLang (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) )]] + + + + + + +
+ [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]] + + + + + + + [[ move_g['code'] ]] + + + [[ move_g['name'] ]] + + + [[ formatLang (move_g['quantity']) ]] + + + + + + + [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]] + [[ formatLang(move_a['date'],date = True) ]] + + + [[ move_a['cj'] ]] + + + [[ move_a['name'] ]] + + + [[ formatLang (move_a['quantity'] )]] + + + + + + +
+ + + + + +
+ + + From c88824db3e1acabc6cf3ed64de8665fbad7135fa Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 27 Jan 2009 15:18:06 +0530 Subject: [PATCH 2/7] set FormatLang function : account/project/report/analytic_journal.rml bzr revid: apa@tinyerp.com-20090127094806-rpqtt689uxluofnt --- addons/account/project/report/analytic_journal.rml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/project/report/analytic_journal.rml b/addons/account/project/report/analytic_journal.rml index d7e9f391114..96383420a1f 100644 --- a/addons/account/project/report/analytic_journal.rml +++ b/addons/account/project/report/analytic_journal.rml @@ -83,8 +83,8 @@ [[ o.code ]] - [[ o.name ]] - [[ '%.2f' % sum_general(o.id,data['form']['date1'],data['form']['date2']) ]] - [[ '%.2f' % sum_analytic(o.id,data['form']['date1'],data['form']['date2']) ]] + [[ formatLang(sum_general(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_analytic(o.id,data['form']['date1'],data['form']['date2'])) ]] @@ -99,7 +99,7 @@ [[ move.name ]] [[ move.account_id.code ]] - [[ move.account_id.name ]] - [[ '%.2f' % (move.debit-move.credit) ]] + [[ formatLang(move.debit-move.credit) ]] @@ -108,13 +108,13 @@ [[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a.date ]] + [[ formatLang(move_a.date,date = True) ]] [[ move_a.code ]] [[ move_a.name ]] [[ move_a.account_id.code ]] - [[ move_a.account_id.name ]] - [[ '%.2f' % move_a.amount ]] + [[ formatLang( move_a.amount) ]] @@ -124,12 +124,12 @@ [[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a.date ]] + [[ formatLang(move_a.date,date = True) ]] [[ move_a.code ]] [[ move_a.name ]] [[move_a.account_id.code ]] - [[ move_a.account_id.name ]] - [[ '%.2f' % move_a.amount ]] + [[ formatLang( move_a.amount) ]] From 7d19b0fd1e754d4b7dc020f618c8e5410a13205d Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 27 Jan 2009 11:06:08 +0100 Subject: [PATCH 3/7] [FIX] bugfixed the incoming tax on onchange of product in supplier invoice and refund [FIX] bugfixed the invoice validation: if we were setting up a customer invoice with a tax in one line and validated it without pressing the compute button first, it was creating the tax line twice. bzr revid: qdp@tinyerp.com-20090127100608-u942qhh9egpa420f --- addons/account/invoice.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 2e5550325b7..de343eedfd1 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -483,13 +483,9 @@ class account_invoice(osv.osv): cur_obj = self.pool.get('res.currency') for inv in self.browse(cr, uid, ids): - if not inv.tax_line: - self.button_compute(cr, uid, [inv.id], context={}, set_total=False) if inv.move_id: continue - if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): - raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) if not inv.date_invoice: self.write(cr, uid, [inv.id], {'date_invoice':time.strftime('%Y-%m-%d')}) company_currency = inv.company_id.currency_id.id @@ -519,6 +515,9 @@ class account_invoice(osv.osv): if not key in tax_key: raise osv.except_osv(_('Warning !'), _('Taxes missing !')) + if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): + raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) + # one move line per tax line iml += ait_obj.move_line_get(cr, uid, inv.id) @@ -986,7 +985,7 @@ class account_invoice_line(osv.osv): taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False) tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) else: - taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False) + taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False) tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) if type in ('in_invoice', 'in_refund'): to_update = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context) From b3339bbbe15581e9e14b6203755ecc07b1661aab Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 27 Jan 2009 15:37:35 +0530 Subject: [PATCH 4/7] Set FormatLang function In : account/project/report/analytic_check.rml bzr revid: apa@tinyerp.com-20090127100735-8d7w51evq0smn300 --- .../account/project/report/analytic_check.rml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/account/project/report/analytic_check.rml b/addons/account/project/report/analytic_check.rml index 0bbc727e9f6..d38ac43adc8 100644 --- a/addons/account/project/report/analytic_check.rml +++ b/addons/account/project/report/analytic_check.rml @@ -141,22 +141,22 @@ - [[ '%.2f' % general_debit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( general_debit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % general_credit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( general_credit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % analytic_debit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( analytic_debit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % analytic_credit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( analytic_credit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % delta_debit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( delta_debit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % delta_credit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( delta_credit(data['form']['date1'],data['form']['date2'])) ]] @@ -167,22 +167,22 @@ [[ acc['name'] ]] - [[ '%.2f' % acc['gen_debit'] ]] + [[ formatLang( acc['gen_debit']) ]] - [[ '%.2f' % acc['gen_credit'] ]] + [[ formatLang( acc['gen_credit']) ]] - [[ '%.2f' % acc['ana_debit'] ]] + [[ formatLang( acc['ana_debit']) ]] - [[ '%.2f' % acc['ana_credit'] ]] + [[ formatLang( acc['ana_credit']) ]] - [[ '%.2f' % acc['delta_debit'] ]] + [[ formatLang( acc['delta_debit']) ]] - [[ '%.2f' % acc['delta_credit'] ]] + [[ formatLang( acc['delta_credit']) ]] From f3bb34bf165f2cc90343b71afc424a0dd881bba1 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 27 Jan 2009 16:31:08 +0530 Subject: [PATCH 5/7] set attrs in wizard(account balance) bzr revid: apa@tinyerp.com-20090127110108-09hu1to63y2zadcy --- .../wizard/wizard_account_balance_report.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index ab03f87bb98..232d2a80475 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -35,17 +35,17 @@ period_form = ''' - - - - + + + + + + + + + + - - - - - - ''' period_fields = { From 414818a5ed2bc07caa346ccc1162965c44ee626c Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 27 Jan 2009 16:34:32 +0530 Subject: [PATCH 6/7] set attr in wizard(general ledger) bzr revid: apa@tinyerp.com-20090127110432-xaye8e8ke1c936pb --- .../wizard/wizard_general_ledger_report.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 84ee61a7005..841f5c8d893 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -51,15 +51,16 @@ period_form = ''' - - - - - - - - - + + + + + + + + + + From 3816d3d423a013ffe7c978e3c3cd42efad79bd63 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 27 Jan 2009 17:38:49 +0530 Subject: [PATCH 7/7] when we have invoice that is proforma or draft, the report invoice should prints proforma. is it ok?==Done bzr revid: apa@tinyerp.com-20090127120849-0a5s6bhjj9zd7zh3 --- addons/account/report/invoice.rml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 2d3ec597087..62df090ed59 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -258,8 +258,8 @@ Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]] - PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]] - PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] + PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]] + Draft [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] @@ -560,4 +560,4 @@ - \ No newline at end of file +