diff --git a/addons/account/account_unit_test.xml b/addons/account/account_unit_test.xml index 97fba380214..e4178517361 100644 --- a/addons/account/account_unit_test.xml +++ b/addons/account/account_unit_test.xml @@ -14,6 +14,13 @@ Test invoice 1 + + Test Tax + 5.00 + 100.00 + + + Basic computer with Dvorak keyboard and left-handed mouse @@ -27,7 +34,7 @@ 800 2 - + EUR diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 36ee5255523..11e8d2e62d6 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -236,6 +236,17 @@ + + account.treasory.graph + account.account + graph + + + + + + + Accounts account.account diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index 5ae2890fd20..190479f63a7 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -20,7 +20,22 @@ graph,tree [('type','=','income')] - + + Company Analysis + account.entries.report + form + tree,graph + {'group_by':['user_type'], 'group_by_no_leaf':1} + + + + Treasory + account.account + form + graph,tree + [('type','=','liquidity')] + + board.account.form board.board @@ -30,10 +45,12 @@ + + - + diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml index 4f495891378..a59e95724d0 100644 --- a/addons/account/project/report/cost_ledger.rml +++ b/addons/account/project/report/cost_ledger.rml @@ -181,13 +181,10 @@ Credit - Balance + Balance - - - @@ -199,21 +196,18 @@ - [[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] - - -
- [[ repeatIn(objects,'o') ]] + [[ repeatIn(objects,'o') ]] @@ -223,21 +217,18 @@ [[ o.complete_name ]] - [[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] [[ formatLang (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol ]] - - -
- [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] + [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] @@ -247,21 +238,18 @@ [[ move_g['name'] ]] - [[ formatLang( move_g['debit']) ]] + [[ formatLang( move_g['debit']) ]] - [[ formatLang( move_g['credit']) ]] + [[ formatLang( move_g['credit']) ]] [[ formatLang( move_g['balance']) ]] [[ company.currency_id.symbol ]] - - -
- [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] + [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] @@ -274,13 +262,13 @@ [[ move_a['name'] ]] - [[ formatLang( move_a['debit'] )]] + [[ formatLang( move_a['debit'] )]] - [[ formatLang( move_a['credit']) ]] + [[ formatLang( move_a['credit']) ]] - [[ formatLang( move_a['balance']) ]] + [[ formatLang( move_a['balance']) ]] [[ company.currency_id.symbol]] @@ -288,13 +276,7 @@
- - -
- - - - + \ No newline at end of file diff --git a/addons/account/report/account_balance_sheet_horizontal.rml b/addons/account/report/account_balance_sheet_horizontal.rml index 08b9030a968..bde0d2786d0 100644 --- a/addons/account/report/account_balance_sheet_horizontal.rml +++ b/addons/account/report/account_balance_sheet_horizontal.rml @@ -233,7 +233,7 @@ [[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] - [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]] + [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code'] and a['name']) and formatLang(abs(a['balance'])) or removeParentNode('font')]] [[ company.currency_id.symbol ]] diff --git a/addons/account/report/account_central_journal.rml b/addons/account/report/account_central_journal.rml index 1045470b2f2..1f4fe48fa79 100644 --- a/addons/account/report/account_central_journal.rml +++ b/addons/account/report/account_central_journal.rml @@ -283,7 +283,7 @@ Balance - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] A/C No. Account Name @@ -293,18 +293,18 @@ Currency - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] - Total([[ company.currency_id.code]]): + Total: [[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id) ) ]] [[ company.currency_id.symbol ]] - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] - Total:([[ company.currency_id.code]]) + Total: [[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] @@ -314,7 +314,7 @@
[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ line['code'] ]] [[ line['name'] ]] @@ -323,19 +323,17 @@ [[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]] - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] [[ line['code'] ]] [[ line['name'] ]] [[ formatLang(line['debit']) ]] [[ formatLang(line['credit'])]] - [[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]] - [[ line['currency_id'] and formatLang(line['amount_currency'] or '') ]] [[ line['currency_id'] and line['currency_code'] or '']] + [[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]] + [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
- - - + diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml index a80fb3c3233..fc75a05e029 100644 --- a/addons/account/report/account_entries_report_view.xml +++ b/addons/account/report/account_entries_report_view.xml @@ -48,6 +48,19 @@
+ + account.company.analysis.tree + account.entries.report + tree + + + + + + + + + account.entries.report.search account.entries.report diff --git a/addons/account/report/account_general_journal.rml b/addons/account/report/account_general_journal.rml index 489416adf76..fdf044c048e 100644 --- a/addons/account/report/account_general_journal.rml +++ b/addons/account/report/account_general_journal.rml @@ -270,7 +270,7 @@ Balance - Total:([[ company.currency_id.code]]) + Total: [[ formatLang(sum_debit()) ]] [[ formatLang( sum_credit()) ]] @@ -373,7 +373,7 @@ [[ formatLang(line['debit'] )]] [[ formatLang(line['credit']) ]] [[ formatLang(line['credit']-line['debit'] ) ]] [[ company.currency_id.symbol ]] - [[ line['currency_id'] and formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]] + [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]] diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index f3ec97a592e..d35f0603ded 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -161,7 +161,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header): else: sql_sort='l.date' sql = """ - SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id, + SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.currency_id,l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id, m.name AS move_name, m.id AS mmove_id, c.symbol AS currency_code, i.id AS invoice_id, i.type AS invoice_type, i.number AS invoice_number, diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml index 6ac6cd51286..917ffa214d8 100644 --- a/addons/account/report/account_general_ledger.rml +++ b/addons/account/report/account_general_ledger.rml @@ -334,7 +334,7 @@ [[ formatLang(line['debit']) ]] [[ formatLang(line['credit']) ]] [[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]] - [[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '']] + [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']] diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index b8fa0e1f374..324cf378177 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -263,13 +263,13 @@ - + [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]] - [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]] - [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]] - [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] - [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]] + [[ formatLang(sum_debit_account(o), dp='Account') ]] + [[ formatLang(sum_credit_account(o), dp='Account') ]] + [[ formatLang(sum_balance_account(o), dp='Account') ]] [[ company.currency_id.symbol ]] + [[ o.currency_id and formatLang(sum_currency_amount_account(o), dp='Account') + o.currency_id.code or '' ]] @@ -292,10 +292,10 @@ [[ line['move'] ]] [[ line['lname'] ]] [[ strip_name(line['line_corresp'].replace(', ',','),40) ]] - [[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]] - [[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]] - [[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] - [[ formatLang(line['amount_currency'] or '')]] [[ line['currency_code'] or '' ]] + [[ formatLang(line['debit'], dp='Account') ]] + [[ formatLang(line['credit'], dp='Account') ]] + [[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]] + [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']] diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml index 3eef3270dd5..ae273ba5647 100644 --- a/addons/account/report/account_partner_ledger.rml +++ b/addons/account/report/account_partner_ledger.rml @@ -289,7 +289,7 @@ Ref. - A/c No.- Name + Account Entry Label @@ -359,7 +359,7 @@ [[ line['move_name'] ]] - [[ line['a_code'] ]] - [[ line['a_name'] ]] + [[ line['a_code'] ]] [[ line['ref'] ]] - [[ line['name'] ]] @@ -391,7 +391,7 @@ Ref. - A/c No.- Name + Account Entry Label @@ -472,7 +472,7 @@ [[ line['move_name'] ]] - [[ line['a_code'] ]] - [[ line['a_name'] ]] + [[ line['a_code'] ]] [[ (line['ref'] or '') + ' ' + line['name'] ]] diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml index 4a07a8ef53c..7d7dd035c3f 100644 --- a/addons/account/report/account_partner_ledger_other.rml +++ b/addons/account/report/account_partner_ledger_other.rml @@ -444,7 +444,7 @@ Ref. - A/c No.- Name + Account Entry Label @@ -507,7 +507,7 @@ [[ line['move_name'] ]] - [[ line['a_code'] ]] - [[ line['a_name'] ]] + [[ line['a_code'] ]] [[ (line['ref'] or '') + ' ' + line['name'] ]] @@ -537,7 +537,7 @@ Ref. - A/c No.- Name + Account Entry Label @@ -612,7 +612,7 @@ [[ line['move_name'] ]] - [[ line['a_code'] ]] - [[ line['a_name'] ]] + [[ line['a_code'] ]] [[ (line['ref'] or '') + ' ' + line['name'] ]] diff --git a/addons/account/report/account_print_overdue.rml b/addons/account/report/account_print_overdue.rml index a0748e281ac..d3d2c77e47a 100644 --- a/addons/account/report/account_print_overdue.rml +++ b/addons/account/report/account_print_overdue.rml @@ -46,11 +46,13 @@ - - - - - + + + + + + + @@ -116,7 +118,7 @@ Document: Customer account statement Date: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] - Customer Ref: [[ o.ref or '' ]] + Customer Ref: [[ o.ref or ' ']] @@ -181,10 +183,10 @@ [[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]] - [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] - [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d'))) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] @@ -195,7 +197,7 @@ - + @@ -206,7 +208,7 @@ Sub-Total : - [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] @@ -220,6 +222,8 @@ + + @@ -230,25 +234,21 @@ Balance : - [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]] + [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]] - - - - - - - - - - - + + + + + + + Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]. diff --git a/addons/account/report/account_profit_horizontal.rml b/addons/account/report/account_profit_horizontal.rml index 8c66f223df9..f92f9e07983 100644 --- a/addons/account/report/account_profit_horizontal.rml +++ b/addons/account/report/account_profit_horizontal.rml @@ -240,7 +240,7 @@ - [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance1'])) ]] [[ company.currency_id.symbol ]] + [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code1'] and a['name1']) and formatLang(abs(a['balance1'])) or removeParentNode('font') ]] [[ company.currency_id.symbol ]] diff --git a/addons/account/report/account_tax_report.rml b/addons/account/report/account_tax_report.rml index 9ad4ff56112..2434437e803 100644 --- a/addons/account/report/account_tax_report.rml +++ b/addons/account/report/account_tax_report.rml @@ -104,7 +104,7 @@ - Taxes + Tax Statement Tax Name diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 7e4295da45b..4bc3b807d28 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -1,6 +1,6 @@ - In order to test the PDF reports defined on an invoice, we will print an Invoice Report -- +- !python {model: account.invoice}: | import netsvc, tools, os (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) @@ -9,7 +9,7 @@ - In order to test the PDF reports defined on a partner, we will print the Overdue Report -- +- !python {model: res.partner}: | import netsvc, tools, os (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')], {}, {}) @@ -18,7 +18,7 @@ - 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')], {}, {}) @@ -30,28 +30,30 @@ - !record {model: account.tax.code, id: account_tax_code_0}: name : Tax Code Test + sign : 10.00 - Print Tax Code entries report -- +- !python {model: account.tax.code}: | import netsvc, tools, os (data, format) = netsvc.LocalService('report.account.tax.code.entries').create(cr, uid, [ref('account_tax_code_0')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data) + - Print Vat Declaration Report - !python {model: account.tax.code}: | import netsvc, tools, os data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}} - (data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_tax_code_0")], data_dict, {}) + (data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_move_0")], data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data) - In order to test the PDF reports defined on an invoice, we will print an invoice -- +- !python {model: account.invoice}: | import netsvc, tools, os (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) @@ -84,9 +86,9 @@ ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) - + data_dict = {'model': 'ir.ui.menu', 'form': {'chart_account_id':ref('account.chart0'),'initial_balance': 1, 'periods': period_list,'journal_ids':journal_ids, 'page_split': 0, 'date_from': time.strftime('%Y-%m-%d'), 'period_length': 30, 'amount_currency': 0,'query_line' : query_line, 'result_selection': 'customer','direction_selection': 'past','fiscalyear_id':fy_id}} data_dict['form'].update(res) (data, format) = netsvc.LocalService('report.account.aged_trial_balance').create(cr, uid, [], data_dict, {}) @@ -122,10 +124,10 @@ (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal.'+format), 'wb+').write(data) - + data_dict.update({'model': 'ir.ui.menu'}) data_dict['form'].update({'active_ids':[ref('account.bal'),ref('account.gpf')]}) - + (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [], data_dict, {'periods': []}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal-menu.'+format), 'wb+').write(data) @@ -145,16 +147,16 @@ ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, journal_period_ids, data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-central_journal.'+format), 'wb+').write(data) - + data_dict.update({'model': 'ir.ui.menu'}) data_dict['form'].update({'active_ids':journal_period_ids}) - + (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, [], data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-central_journal-menu.'+format), 'wb+').write(data) @@ -167,13 +169,13 @@ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context) - + obj_move = self.pool.get('account.move.line') ctx = {} ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) data_dict = {'model': 'ir.ui.menu','id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids, 'active_ids':journal_period_ids}} (data, format) = netsvc.LocalService('report.account.general.journal').create(cr, uid, journal_period_ids, data_dict, {}) @@ -189,15 +191,15 @@ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] acc_ids = [ref('account.bal'),ref('account.gpf')] - + obj_move = self.pool.get('account.move.line') ctx = {} ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) - + data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query': query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, acc_ids, data_dict, {}) if tools.config['test_report_directory']: @@ -217,15 +219,15 @@ period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] acc_ids = [ref('account.bal'),ref('account.gpf')] - + obj_move = self.pool.get('account.move.line') ctx = {} ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) - + data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query':query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':1,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, acc_ids, data_dict, {}) if tools.config['test_report_directory']: @@ -252,17 +254,17 @@ ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) - + data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'sort_selection': 'date','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, journal_period_ids, data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-print_journal.'+format), 'wb+').write(data) - + data_dict.update({'model': 'ir.ui.menu'}) data_dict['form'].update({'active_ids':journal_period_ids}) - + (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, [], data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-print_journal-menu.'+format), 'wb+').write(data) @@ -275,16 +277,17 @@ fy_id = ref('account.data_fiscalyear') period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] - + journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context) obj_move = self.pool.get('account.move.line') ctx = {} ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) - data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} - (data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, [], data_dict, {}) + + data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'active_ids':journal_period_ids,'display_partner': 'all','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} + (data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, journal_period_ids, data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-partner_balance.'+format), 'wb+').write(data) @@ -302,9 +305,9 @@ ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) - + data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': True,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} (data, format) = netsvc.LocalService('report.account.third_party_ledger').create(cr, uid, [], data_dict, {}) if tools.config['test_report_directory']: @@ -324,7 +327,7 @@ ctx['fiscalyear'] = fy_id ctx['journal_ids'] = journal_ids ctx['chart_account_id'] = ref('account.chart0') - + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': False,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} (data, format) = netsvc.LocalService('report.account.third_party_ledger_other').create(cr, uid, [], data_dict, {}) diff --git a/addons/account/test/account_validate_account_move.yml b/addons/account/test/account_validate_account_move.yml index 37d64ead528..9a733d8ad5f 100644 --- a/addons/account/test/account_validate_account_move.yml +++ b/addons/account/test/account_validate_account_move.yml @@ -1,3 +1,12 @@ +- + Demo data for Account tax code +- + !record {model: account.tax.code, id: account_tax_code_0}: + name : Tax Code Test + sign : 1.00 +- + + - In order to test the 'Validate Journal Entries' wizard in OpenERP, I created an account move @@ -20,6 +29,7 @@ - journal_id: account.bank_journal period_id: account.period_6 ref: '2010010' + tax_code_id: account_tax_code_0 tax_amount: 0.0 account_id: account.a_recv amount_currency: 0.0 diff --git a/addons/account/wizard/account_vat_view.xml b/addons/account/wizard/account_vat_view.xml index 018c753a7c2..16bb39e22cd 100644 --- a/addons/account/wizard/account_vat_view.xml +++ b/addons/account/wizard/account_vat_view.xml @@ -16,7 +16,7 @@