diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index 7084aa8c07f..d525d3a331b 100755 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -39,8 +39,6 @@ import account_invoice_report import account_report import account_entries_report import account_analytic_entries_report -#import voucher_print -import account_voucher_print import account_balance_sheet import account_profit_loss diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 00fa1f58ff6..1d8fccc251f 100755 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -20,6 +20,7 @@ ############################################################################## import time + from report import report_sxw from common_report_header import common_report_header diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml index 8eefe75838f..d2d5883e947 100755 --- a/addons/account/report/account_entries_report_view.xml +++ b/addons/account/report/account_entries_report_view.xml @@ -80,7 +80,7 @@ - + diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index d712b984d88..53f85dd4860 100755 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -103,8 +103,8 @@ class general_ledger(report_sxw.rml_parse, common_report_header): def get_children_accounts(self, account): res = [] - ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id) currency_obj = self.pool.get('res.currency') + ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id) currency = account.currency_id and account.currency_id or account.company_id.currency_id for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc, context=self.context): sql = """ diff --git a/addons/account/report/account_voucher_print.py b/addons/account/report/account_voucher_print.py deleted file mode 100755 index 912e0794a9c..00000000000 --- a/addons/account/report/account_voucher_print.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved -# $Id$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time -from report import report_sxw -from tools import amount_to_text_en - -class report_voucher_move(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context=None): - super(report_voucher_move, self).__init__(cr, uid, name, context=context) - self.localcontext.update({ - 'time': time, - 'convert':self.convert, - 'get_title': self.get_title, - 'debit':self.debit, - 'credit':self.credit, - }) - self.user = uid - - def convert(self, amount): - user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0] - return amount_to_text_en.amount_to_text(amount, 'en', user_id.company_id.currency_id.name) - - def get_title(self, voucher): - title = '' - if voucher.journal_id: - type = voucher.journal_id.type - title = type[0].swapcase() + type[1:] + " Voucher" - return title - - def debit(self, move_ids): - debit = 0.0 - for move in move_ids: - debit +=move.debit - return debit - - def credit(self, move_ids): - credit = 0.0 - for move in move_ids: - credit +=move.credit - return credit - -report_sxw.report_sxw( - 'report.account.move.voucher', - 'account.move', - 'addons/account/report/account_voucher_print.rml', - parser=report_voucher_move,header="external" -) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/report/account_voucher_print.rml b/addons/account/report/account_voucher_print.rml deleted file mode 100755 index 1d8f237c132..00000000000 --- a/addons/account/report/account_voucher_print.rml +++ /dev/null @@ -1,470 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Particulars - - - Debit - - - Credit - - - - - [[ repeatIn(objects,'voucher') ]] - - - - [[ get_title(voucher) ]] - - - - - - - - - - Journal: - - - [[ voucher.journal_id.name ]] - - - Number: - - - [[ voucher.name ]] - - - - - - - State: - - - PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]] - Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]] - Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]] - Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]] - - - Ref. : - - - [[ voucher.ref]] - - - Date: - - - [[ formatLang(voucher.date , date=True) or '' ]] - - - - - - - - - - - - - Particulars - - - Debit - - - Credit - - - - - - -
- [[ repeatIn(voucher.line_id,'line_id') ]] - - - - [[ (line_id.partner_id and line_id.partner_id.name) or 'Account']] - - - [[ formatLang(line_id.debit) ]] - - - [[ formatLang(line_id.credit) ]] - - - - - [[ line_id.account_id.name ]] - - - - - - - - - - - - - - - [[ line_id.name ]]-[[voucher.ref]] - - - - - - - - - - - - - - - - -
- - - - - - - Through : - - - - - - - - - - - - - - - [[ voucher.narration or '']] - - - - - - - - - - - - - - - On Account of : - - - - - - - - - - - - - - - [[ voucher.line_id and voucher.line_id[0].name or removeParentNode('para') ]] - - - - - - - - - - - - - - - Amount (in words) : - - - - - - - - - - - - - - - [[ convert(voucher.amount) ]] - - - - - - - - - - - - - - - - - - - - - - - - - [[ formatLang(debit(voucher.line_id))]] - - - [[ formatLang(credit(voucher.line_id)) ]] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Receiver's Signature - - - - - - - - - - - - - Authorised Signatory - - - - - - -
-
-
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 312db44cd0c..d5bb6bada65 100755 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -28,14 +28,6 @@ (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) -- - In order to test the PDF reports defined on Account Move, we will print the Voucher Report -- - !python {model: account.move}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data) - Print the Aged Partner Balance Report - @@ -44,7 +36,7 @@ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) data_dict = {'chart_account_id':ref('account.chart0')} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Sheet in Horizontal mode - @@ -53,7 +45,7 @@ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Sheet in Normal mode - @@ -62,7 +54,7 @@ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Report in Normal mode through the wizard - From Account Chart - @@ -157,7 +149,7 @@ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Profit-Loss Report in Horizontal Mode - @@ -166,7 +158,7 @@ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Analytic Balance Report through the wizard - @@ -215,4 +207,4 @@ ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) data_dict = {} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml index 61e0a7dd7f9..ff4cfd8575b 100755 --- a/addons/project_long_term/project_long_term_view.xml +++ b/addons/project_long_term/project_long_term_view.xml @@ -154,6 +154,8 @@ + + @@ -172,6 +174,7 @@ +