From 14d55ddd6dbcb00cf23237a91a9467a89d232e55 Mon Sep 17 00:00:00 2001 From: "SAZ(OpenERP)" <> Date: Fri, 24 Sep 2010 16:13:20 +0530 Subject: [PATCH] [FIX] hr_timesheet_invoice : Passed the yaml report test bzr revid: jvo@tinyerp.com-20100924104320-2f7dgfk43rp1i6l1 --- .../report/account_analytic_profit.rml | 118 +++++++++--------- .../test/hr_timesheet_invoice_report.yml | 2 +- 2 files changed, 62 insertions(+), 58 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml index 3cb4b150395..b6d9f155cab 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml @@ -74,24 +74,24 @@ - + - - + + - - - - - + + + + + - - + + @@ -115,8 +115,8 @@ + - @@ -157,12 +157,10 @@ - [[ formatLang (data['form']['date_from'],date=True) -]] + [[ formatLang(data['form']['date_from'],date=True) ]] - [[ formatLang (data['form']['date_to'],date=True) - ]] + [[ formatLang (data['form']['date_to'] ,date=True)]] [[ company.currency_id.name ]] @@ -209,7 +207,7 @@ Totals: - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] @@ -217,47 +215,47 @@ - [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) and round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) and round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] %
[[ repeatIn(user_ids(lines(data['form'])), 'e') ]] - + [[ e.name ]] - [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] + [[ repeatIn(journal_ids(data['form'], [e.id]), 'j') ]] - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) and (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0)]] % + [[reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) and '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0, 2)]] % @@ -298,35 +296,41 @@ -
+ + +
- [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] - - - - [[ l['name'] ]] - - - [[ l['unit_amount'] ]] - - - [[ l['amount_th'] ]] - - - [[ l['amount'] ]] - - - [[ l['cost'] ]] - - - [[ l['profit'] ]] - - - [[ l['eff'] ]] % - - - - + [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] + + + + [[ l['name'] ]] + + + [[ l['unit_amount'] ]] + + + [[ l['amount_th'] ]] + + + [[ l['amount'] ]] + + + [[ l['cost'] ]] + + + [[ l['profit'] ]] + + + [[ l['eff'] ]] % + + + + + + +
+ @@ -334,4 +338,4 @@
- \ No newline at end of file + diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml index ecdd486a65e..32f22e7eb4b 100644 --- a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -3,7 +3,7 @@ - !python {model: account.analytic.line}: | import netsvc, tools, os, time - data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee1'), ref('hr.employee2'),ref('hr.employee3')]]], 'journal_ids': [[6,0,[ref('account.cose_journal_sale'),ref('account.exp'),ref('account.sit')]]], 'date_to': time.strftime('%Y-%m-%d')}} + data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee1'), ref('hr.employee2'),ref('hr.employee3')]]], 'journal_ids': [[6,0,[ref('hr_timesheet.analytic_journal')]]], 'date_to': time.strftime('%Y-%m-%d')}} (data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data)