diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 39e40555f39..ace32fe1b0c 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -18,8 +18,6 @@ # along with this program. If not, see . # ############################################################################## - - { "name" : "Accounting and Financial Management", "version" : "1.1", @@ -57,6 +55,7 @@ module named account_vouchers 'wizard/account_use_model_view.xml', 'account_view.xml', 'account_report.xml', + 'wizard/account_common_report.xml', 'wizard/account_invoice_refund_view.xml', 'wizard/account_period_close_view.xml', 'wizard/account_fiscalyear_close_state.xml', @@ -77,7 +76,7 @@ module named account_vouchers 'wizard/account_validate_move_view.xml', 'wizard/account_pay_invoice_view.xml', 'wizard/account_unreconcile_view.xml', - 'wizard/account_general_ledger_report_view.xml', + 'wizard/account_report_general_ledger_view.xml', 'wizard/account_invoice_state_view.xml', 'wizard/account_partner_balance_report_view.xml', 'wizard/account_balance_report_view.xml', @@ -119,6 +118,8 @@ module named account_vouchers 'report/account_account_report_view.xml', 'report/account_analytic_entries_report_view.xml', 'board_account_view.xml', + "wizard/account_pl_report_view.xml", + "wizard/account_bs_report_view.xml" ], 'demo_xml': [ #'demo/price_accuracy00.yml', @@ -145,4 +146,4 @@ module named account_vouchers 'active': False, 'certificate': '0080331923549', } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/account.py b/addons/account/account.py index 54354b4ea90..210ae5b3157 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -586,7 +586,7 @@ class account_journal_column(osv.osv): for col in cols: if col in ('period_id', 'journal_id'): continue - + result.append( (col, cols[col].string) ) result.sort() return result @@ -687,8 +687,7 @@ class account_fiscalyear(osv.osv): _columns = { 'name': fields.char('Fiscal Year', size=64, required=True), 'code': fields.char('Code', size=6, required=True), - 'company_id': fields.many2one('res.company', 'Company', - help="Keep empty if the fiscal year belongs to several companies.", required=True), + 'company_id': fields.many2one('res.company', 'Company', required=True), 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), 'period_ids': fields.one2many('account.period', 'fiscalyear_id', 'Periods'), @@ -772,7 +771,7 @@ class account_period(osv.osv): 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True), 'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True, help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'), - 'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True) + 'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company'), } _defaults = { 'state': lambda *a: 'draft', diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 74e895d9a04..56d83debe4c 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -2,30 +2,30 @@ - + - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + @@ -38,7 +38,7 @@ - + diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index fc622d8f0c0..8b4aa147a95 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -61,21 +61,6 @@ parent="menu_tax_report" type="wizard"/> --> - - - Chart of Taxes - account.tax.code - [('parent_id','=',False)] - tree - - - - - - + + # Payment Terms + --> account.payment.term.line.tree diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index 260876a98eb..8fa4b8065fb 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -1,12 +1,12 @@ - - - - - - + + + + + + @@ -75,7 +75,7 @@ - + @@ -94,30 +94,30 @@ --> - + - + - - + + - + --> diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index ad965e04b57..ee139c3040c 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -40,5 +40,7 @@ import account_account_report import account_entries_report import account_analytic_entries_report import voucher_print +import report_bs +import report_pl # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 32186c269f9..195d6bc5746 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -40,12 +40,9 @@ class general_ledger(rml_parse.rml_parse): new_ids = [] if (data['model'] == 'account.account'): new_ids = 'active_ids' in data['form']['context'] and data['form']['context']['active_ids'] or [] - #new_ids = ids else: - new_ids.append(data['form']['Account_list']) - - objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) - + new_ids.append(data['form']['chart_account_id']) + objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) super(general_ledger, self).set_context(objects, data, new_ids, report_type) def __init__(self, cr, uid, name, context): @@ -81,7 +78,7 @@ class general_ledger(rml_parse.rml_parse): res = self.cr.dictfetchall() borne_min = res[0]['start_date'] borne_max = res[0]['stop_date'] - if form['state'] == 'byperiod': + if form['filter'] == 'filter_period': ## This function will return the most aged date periods = form['periods'] #periods = form['periods'][0][2] @@ -99,43 +96,10 @@ class general_ledger(rml_parse.rml_parse): res = self.cr.dictfetchall() borne_min = res[0]['start_date'] borne_max = res[0]['stop_date'] - elif form['state'] == 'bydate': + elif form['filter'] == 'filter_date': borne_min = form['date_from'] borne_max = form['date_to'] - elif form['state'] == 'all': - periods = form['periods'] - #periods = form['periods'][0][2] - if not periods: - sql = """ - SELECT MIN(p.date_start) AS start_date, - MAX(p.date_stop) AS stop_date - FROM account_period AS p - WHERE p.fiscalyear_id = %s - """ - sqlargs = (form['fiscalyear'],) - else: - sql = """ - SELECT MIN(p.date_start) AS start_date, - MAX(p.date_stop) AS stop_date - FROM account_period AS p - WHERE p.id IN %s - """ - sqlargs = (tuple(periods),) - self.cr.execute(sql, sqlargs) - res = self.cr.dictfetchall() - period_min = res[0]['start_date'] - period_max = res[0]['stop_date'] - date_min = form['date_from'] - date_max = form['date_to'] - if period_min%%s), ', ') AS counterpart - FROM (SELECT move_id FROM account_move_line l WHERE %s AND l.account_id = %%s AND l.date<=%%s AND l.date>=%%s GROUP BY move_id) m1 + FROM (SELECT move_id FROM account_move_line l WHERE %s AND l.account_id = %%s GROUP BY move_id) m1 """ % self.query - self.cr.execute(sql, (account.id, account.id, self.date_borne['max_date'], self.date_borne['min_date'])) + self.cr.execute(sql, (account.id, account.id)) counterpart_res = self.cr.dictfetchall() counterpart_accounts = {} for i in counterpart_res: @@ -248,10 +191,10 @@ class general_ledger(rml_parse.rml_parse): del counterpart_res # Then select all account_move_line of this account - if form['sortbydate'] == 'sort_date': - sql_sort='l.date' + if form['sortby'] == 'sort_journal_partner': + sql_sort='j.code, p.name' else: - sql_sort='j.code' + sql_sort='l.date' sql = """ SELECT l.id, l.date, j.code, l.amount_currency,l.ref, l.name, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id, l.partner_id, m.name AS move_name, m.id AS move_id, @@ -264,9 +207,9 @@ class general_ledger(rml_parse.rml_parse): LEFT JOIN res_partner p on (l.partner_id=p.id) LEFT JOIN account_invoice i on (m.id =i.move_id) JOIN account_journal j on (l.journal_id=j.id) - WHERE %s AND l.account_id = %%s AND l.date<=%%s AND l.date>=%%s ORDER by %s + WHERE %s AND l.account_id = %%s ORDER by %s """ % (self.query, sql_sort) - self.cr.execute(sql, (account.id, self.date_borne['max_date'], self.date_borne['min_date'])) + self.cr.execute(sql, (account.id,)) res = self.cr.dictfetchall() account_sum = 0.0 account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') @@ -278,8 +221,6 @@ class general_ledger(rml_parse.rml_parse): l['ref'] = '%s: %s'%(inv_types[l['invoice_type']], l['invoice_number']) l['partner'] = l['partner_name'] or '' account_sum = l['debit'] - l ['credit'] - #c = time.strptime(l['date'],"%Y-%m-%d") - #l['date'] = time.strftime("%d-%m-%Y",c) l['progress'] = account_sum l['line_corresp'] = counterpart_accounts[l['move_id']] # Modification du amount Currency @@ -314,9 +255,6 @@ class general_ledger(rml_parse.rml_parse): sum_credit = self.cr.fetchone()[0] or 0.0 if form.get('soldeinit', False): sum_credit += account.init_credit - # - ## - return sum_credit def _sum_solde_account(self, account, form): diff --git a/addons/account/report/general_ledger.rml b/addons/account/report/general_ledger.rml index c69c981e35c..c66f0eba502 100644 --- a/addons/account/report/general_ledger.rml +++ b/addons/account/report/general_ledger.rml @@ -91,7 +91,7 @@ [[ repeatIn(objects, 'a') ]] - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[data['form']['amount_currency'] == False or removeParentNode('blockTable')]] Date Partner @@ -102,46 +102,45 @@ Crebit Balance - -
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] - - - - - [[ o.code or '']] [[ o.name or '']] - - [[formatLang(sum_debit_account(o, data['form'])) ]] - [[formatLang(sum_credit_account(o, data['form'])) ]] - [[formatLang(sum_solde_account(o, data['form'])) ]] - - - - - - - - - - - - - [[ repeatIn(lines(o, data['form']), 'line') ]] [[ formatLang(line['date'],date=True) ]] - [[ line['partner'] or '']] - [[ line['ref'] or '']] - [[ line['move'] or '']] - [[ line['name'] or '' ]] - [[ formatLang(line['debit']) ]] - [[ formatLang(line['credit']) ]] - [[ formatLang(line['progress']) ]] - - -
- - +
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] +
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] + [[data['form']['amount_currency'] == False or removeParentNode('blockTable')]] + + + + + [[ o.code or '']] [[ o.name or '']] + + [[formatLang(sum_debit_account(o, data['form'])) ]] + [[formatLang(sum_credit_account(o, data['form'])) ]] + [[formatLang(sum_solde_account(o, data['form'])) ]] + + + + + + + + + + + + + [[ repeatIn(lines(o, data['form']), 'line') ]] [[ formatLang(line['date'],date=True) ]] + [[ line['partner'] or '']] + [[ line['ref'] or '']] + [[ line['move'] or '']] + [[ line['name'] or '' ]] + [[ formatLang(line['debit']) ]] + [[ formatLang(line['credit']) ]] + [[ formatLang(line['progress']) ]] + + +
+ + [[data['form']['amount_currency'] == True or removeParentNode('blockTable')]] Date Partner @@ -155,18 +154,18 @@
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[repeatIn(get_children_accounts(a,data['form']), 'o')]] + [[data['form']['amount_currency'] == True or removeParentNode('blockTable')]] [[ o.code or '' ]] [[ o.name or '' ]] - [[ formatLang(sum_debit_account(o, data['form'])) ]] + [[formatLang(sum_debit_account(o, data['form'])) ]] [[formatLang(sum_credit_account(o, data['form'])) ]] [[formatLang(sum_solde_account(o, data['form'])) ]] - [[ formatLang(sum_currency_amount_account(a, data['form'])) ]] + [[formatLang(sum_currency_amount_account(a, data['form'])) ]] @@ -193,7 +192,4 @@
- - - diff --git a/addons/account/report/general_ledger_landscape.rml b/addons/account/report/general_ledger_landscape.rml index a707a47d0bd..14e7d6b8c4c 100644 --- a/addons/account/report/general_ledger_landscape.rml +++ b/addons/account/report/general_ledger_landscape.rml @@ -84,7 +84,7 @@ [[ repeatIn(objects, 'a') ]] - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[data['form']['amount_currency'] == True or removeParentNode('blockTable')]] Date JNRL @@ -104,7 +104,7 @@ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[data['form']['amount_currency'] == True or removeParentNode('blockTable')]] @@ -165,7 +165,7 @@ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[data['form']['amount_currency'] == False or removeParentNode('blockTable')]] diff --git a/addons/account_report_india/report/report_balance_sheet.rml b/addons/account/report/report_balance_sheet.rml similarity index 100% rename from addons/account_report_india/report/report_balance_sheet.rml rename to addons/account/report/report_balance_sheet.rml diff --git a/addons/account_report_india/report/report_balance_sheet_horizontal.rml b/addons/account/report/report_balance_sheet_horizontal.rml similarity index 100% rename from addons/account_report_india/report/report_balance_sheet_horizontal.rml rename to addons/account/report/report_balance_sheet_horizontal.rml diff --git a/addons/account_report_india/report/report_bs.py b/addons/account/report/report_bs.py similarity index 96% rename from addons/account_report_india/report/report_bs.py rename to addons/account/report/report_bs.py index 51b2f349224..5a7294338c5 100644 --- a/addons/account_report_india/report/report_bs.py +++ b/addons/account/report/report_bs.py @@ -24,7 +24,7 @@ import time import mx.DateTime import rml_parse from report import report_sxw -from account_report_india.report import report_pl +from account.report import report_pl class report_balancesheet_horizontal(rml_parse.rml_parse): def __init__(self, cr, uid, name, context): @@ -195,9 +195,9 @@ class report_balancesheet_horizontal(rml_parse.rml_parse): return comp_obj.name report_sxw.report_sxw('report.account.balancesheet.horizontal', 'account.account', - 'addons/account_report_india/report/report_balance_sheet_horizontal.rml',parser=report_balancesheet_horizontal, + 'addons/account/report/report_balance_sheet_horizontal.rml',parser=report_balancesheet_horizontal, header=False) report_sxw.report_sxw('report.account.balancesheet', 'account.account', - 'addons/account_report_india/report/report_balance_sheet.rml',parser=report_balancesheet_horizontal, + 'addons/account/report/report_balance_sheet.rml',parser=report_balancesheet_horizontal, header=False) diff --git a/addons/account_report_india/report/report_pl.py b/addons/account/report/report_pl.py similarity index 96% rename from addons/account_report_india/report/report_pl.py rename to addons/account/report/report_pl.py index b8b77e08be9..c693b9940c9 100644 --- a/addons/account_report_india/report/report_pl.py +++ b/addons/account/report/report_pl.py @@ -170,8 +170,8 @@ class report_pl_account_horizontal(rml_parse.rml_parse): return comp_obj.name report_sxw.report_sxw('report.pl.account.horizontal', 'account.account', - 'addons/account_report_india/report/report_pl_account_horizontal.rml',parser=report_pl_account_horizontal, header=False) + 'addons/account/report/report_pl_account_horizontal.rml',parser=report_pl_account_horizontal, header=False) report_sxw.report_sxw('report.pl.account', 'account.account', - 'addons/account_report_india/report/report_pl_account.rml',parser=report_pl_account_horizontal, header=False) + 'addons/account/report/report_pl_account.rml',parser=report_pl_account_horizontal, header=False) diff --git a/addons/account_report_india/report/report_pl_account.rml b/addons/account/report/report_pl_account.rml similarity index 100% rename from addons/account_report_india/report/report_pl_account.rml rename to addons/account/report/report_pl_account.rml diff --git a/addons/account_report_india/report/report_pl_account_horizontal.rml b/addons/account/report/report_pl_account_horizontal.rml similarity index 100% rename from addons/account_report_india/report/report_pl_account_horizontal.rml rename to addons/account/report/report_pl_account_horizontal.rml diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py index c56c6c2e764..1231c67463a 100644 --- a/addons/account/wizard/__init__.py +++ b/addons/account/wizard/__init__.py @@ -19,6 +19,8 @@ # ############################################################################## +import account_common_report + import account_automatic_reconcile import account_move_line_reconcile_select import account_move_line_unreconcile_select @@ -32,7 +34,8 @@ import account_journal_select import account_move_bank_reconcile import account_subscription_generate import account_aged_trial_balance -import account_general_ledger_report +#import account_general_ledger_report +import account_report_general_ledger import account_third_party_ledger import account_partner_balance_report import account_balance_report @@ -58,6 +61,8 @@ import account_central_journal import account_general_journal import account_change_currency +import account_bs_report +import account_pl_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report_india/wizard/account_bs_report.py b/addons/account/wizard/account_bs_report.py similarity index 100% rename from addons/account_report_india/wizard/account_bs_report.py rename to addons/account/wizard/account_bs_report.py diff --git a/addons/account_report_india/wizard/account_bs_report_view.xml b/addons/account/wizard/account_bs_report_view.xml similarity index 96% rename from addons/account_report_india/wizard/account_bs_report_view.xml rename to addons/account/wizard/account_bs_report_view.xml index 0dc3faa5a4a..a07ef94d81c 100644 --- a/addons/account_report_india/wizard/account_bs_report_view.xml +++ b/addons/account/wizard/account_bs_report_view.xml @@ -8,14 +8,16 @@ form
- +