From e216fa70544d1ebdcd020c28d656385932c0625a Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Fri, 9 Jul 2010 10:24:54 +0530 Subject: [PATCH] [IMP]: accounting and related improvements bzr revid: mga@tinyerp.com-20100709045454-oex2wcpshaecp85r --- addons/account/account.py | 17 +- addons/account/account_menuitem.xml | 2 +- addons/account/account_view.xml | 65 +- .../crossovered_budget_demo.xml | 652 +++++++++--------- .../account_followup_view.xml | 2 +- addons/account_voucher/voucher.py | 19 +- addons/account_voucher/voucher_view.xml | 18 +- addons/account_voucher/voucher_workflow.xml | 8 +- .../account_voucher_payment.py | 10 +- addons/l10n_ch/demo/vaudtax_data_demo.xml | 158 +++-- 10 files changed, 491 insertions(+), 460 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 322d77eced9..73e1fdd0b7e 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2413,6 +2413,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') + data_pool = self.pool.get('ir.model.data') # Creating Account obj_acc_root = obj_multi.chart_template_id.account_root_id @@ -2523,7 +2524,10 @@ class wizard_multi_charts_accounts(osv.osv_memory): # Creating Journals vals_journal={} - view_id = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Journal View')])[0] + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_view')]) + data = data_pool.browse(cr, uid, data_id[0]) + view_id = data.res_id + seq_id = obj_sequence.search(cr, uid, [('name','=','Account Journal')])[0] if obj_multi.seq_journal: @@ -2560,8 +2564,15 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) # Bank Journals - view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name - view_id_cur = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')]) + data = data_pool.browse(cr, uid, data_id[0]) + view_id_cash = data.res_id + #view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name + + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')]) + data = data_pool.browse(cr, uid, data_id[0]) + ref_acc_bank = data.res_id + #ref_acc_bank = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id current_num = 1 diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 56d83debe4c..e0ac10abb50 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -8,7 +8,7 @@ - + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index daae3043a41..80fb20e1fad 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -358,14 +358,11 @@ - - - @@ -1130,10 +1127,6 @@ - - - - @@ -1179,15 +1172,21 @@ src_model="account.move"/> - Journal Entries to Review + Journal Entries ir.actions.act_window account.move form - [('to_check','=',True)] + [('to_check','=',True), ('state','=','draft')] - + + + @@ -1553,7 +1552,7 @@ - + @@ -1842,17 +1841,17 @@ search - - - - - + + + + + - - - + + + @@ -1878,7 +1877,7 @@ form
- + @@ -1903,19 +1902,19 @@ search - - - - - - + + + + + + - + @@ -2060,20 +2059,20 @@ - + account.tax.code.template.search account.tax.code.template search - - - - + + + + - + diff --git a/addons/account_budget/crossovered_budget_demo.xml b/addons/account_budget/crossovered_budget_demo.xml index 8e9ba6a9493..7c4c6e3ea15 100644 --- a/addons/account_budget/crossovered_budget_demo.xml +++ b/addons/account_budget/crossovered_budget_demo.xml @@ -2,337 +2,337 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index 50c1cb5df34..82e3450163a 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -153,8 +153,8 @@ form - + diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 00d12f8063b..13df5a496fc 100644 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -212,9 +212,21 @@ class account_voucher(osv.osv): self.write(cr, uid, ids, {'state':'posted'}) return True - def action_cancel_draft(self, cr, uid, ids, *args): + def action_cancel_draft(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'draft'}) return True + + def audit_pass(self, cr, uid, ids, context={}): + move_pool = self.pool.get('account.move') + result = True + audit_pass = [] + for voucher in self.browse(cr, uid, ids): + if voucher.move_id and voucher.move_id.state == 'draft': + result = result and move_pool.button_validate(cr, uid, [voucher.move_id.id]) + audit_pass += [voucher.id] + + self.write(cr, uid, audit_pass, {'state':'audit'}) + return result def cancel_voucher(self, cr, uid, ids, context={}): move_pool = self.pool.get('account.move') @@ -258,7 +270,6 @@ class account_voucher(osv.osv): company_currency = inv.company_id.currency_id.id diff_currency_p = inv.currency_id.id <> company_currency - ref = inv.reference journal = journal_pool.browse(cr, uid, inv.journal_id.id) if journal.sequence_id: @@ -289,7 +300,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': False, - 'ref': ref, + 'ref': inv.reference, 'date': inv.date } if diff_currency_p: @@ -318,7 +329,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': line.partner_id.id or False, - 'ref': ref, + 'ref': line.ref, 'date': inv.date, 'analytic_account_id': False } diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml index 1d9d1e6a8d0..658b8f8429b 100644 --- a/addons/account_voucher/voucher_view.xml +++ b/addons/account_voucher/voucher_view.xml @@ -199,12 +199,28 @@ + + + Vouchers Entries + account.voucher + form + tree,form + + [('state','=','posted')] + {'state':'posted'} + + + + diff --git a/addons/account_voucher/voucher_workflow.xml b/addons/account_voucher/voucher_workflow.xml index 091e84cfd88..f1444761c48 100644 --- a/addons/account_voucher/voucher_workflow.xml +++ b/addons/account_voucher/voucher_workflow.xml @@ -18,16 +18,14 @@ proforma - write({'state':'proforma'}) - open_voucher() + open_voucher() function done - write({'state':'posted'}) - proforma_voucher() + proforma_voucher() function @@ -48,7 +46,7 @@ audit - write({'state':'audit'}) + audit_pass() True function diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py index 39c67787157..f2c6507181c 100755 --- a/addons/account_voucher_payment/account_voucher_payment.py +++ b/addons/account_voucher_payment/account_voucher_payment.py @@ -53,8 +53,7 @@ class account_voucher(osv.osv): company_currency = inv.company_id.currency_id.id diff_currency_p = inv.currency_id.id <> company_currency - ref = inv.reference - + journal = journal_pool.browse(cr, uid, inv.journal_id.id) if journal.sequence_id: name = sequence_pool.get_id(cr, uid, journal.sequence_id.id) @@ -84,7 +83,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': False, - 'ref': ref, + 'ref': inv.reference, 'date': inv.date } if diff_currency_p: @@ -113,7 +112,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': line.partner_id.id or False, - 'ref': ref, + 'ref': line.ref, 'date': inv.date, 'analytic_account_id': False } @@ -198,7 +197,8 @@ class account_voucher_line(osv.osv): res.update({ 'amount': residual, - 'account_id': invoice.account_id.id + 'account_id': invoice.account_id.id, + 'ref':invoice.number }) return { diff --git a/addons/l10n_ch/demo/vaudtax_data_demo.xml b/addons/l10n_ch/demo/vaudtax_data_demo.xml index 1da57c59ff4..cf00001a81b 100644 --- a/addons/l10n_ch/demo/vaudtax_data_demo.xml +++ b/addons/l10n_ch/demo/vaudtax_data_demo.xml @@ -1,88 +1,84 @@ - - My bank ! - banq - Banque - - - - +41 31 622 13 00 - Marc Dufour - 1015 - Lausanne - - - M. - tinyerp@bank.com - +41 24 620 10 12 - PSE-C - 1 - default - + + My bank ! + banq + Banque + + + + +41 31 622 13 00 + Marc Dufour + 1015 + Lausanne + + + tinyerp@bank.com + +41 24 620 10 12 + PSE-C + 1 + default + - - Very good company! - They provides a very high quality service. - ProL - http://camptocamp.com - ProLibre - - + + Very good company! + They provides a very high quality service. + ProL + http://camptocamp.com + ProLibre + + - - Very good company! - They provides a very high quality service. - c2c - http://camptocamp.com - camptocamp SA - - - + + Very good company! + They provides a very high quality service. + c2c + http://camptocamp.com + camptocamp SA + + + - - +41 21 619 10 00 - Luc Maurer - 1015 - Lausanne - - - M. - tinyerp@camptocamp.com - +41 21 619 10 12 - PSE-A, EPFL - 1 - default - - - Gilbert Robert - 1227 - Carouge - - - M. - info@prolibre.com - +41 22 3015383 - 18, rue des Moraines - 1 - default - - - +41 21 619 10 00 - Claude Philipona - 1015 - Lausanne - - - M. - tinyerp@camptocamp.com - +41 21 619 10 12 - PSE-A, EPFL - 1 - default - - + + +41 21 619 10 00 + Luc Maurer + 1015 + Lausanne + + + tinyerp@camptocamp.com + +41 21 619 10 12 + PSE-A, EPFL + 1 + default + + + Gilbert Robert + 1227 + Carouge + + + info@prolibre.com + +41 22 3015383 + 18, rue des Moraines + 1 + default + + + +41 21 619 10 00 + Claude Philipona + 1015 + Lausanne + + + tinyerp@camptocamp.com + +41 21 619 10 12 + PSE-A, EPFL + 1 + default + +