diff --git a/addons/.project.moved b/addons/.project.moved new file mode 100644 index 00000000000..45b85705360 --- /dev/null +++ b/addons/.project.moved @@ -0,0 +1,17 @@ + + + new-report-apa + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/addons/.pydevproject b/addons/.pydevproject new file mode 100644 index 00000000000..78259a9c3db --- /dev/null +++ b/addons/.pydevproject @@ -0,0 +1,6 @@ + + + + +python 2.4 + diff --git a/addons/account/account.py b/addons/account/account.py index 94086e86742..e3d257b33fa 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -141,7 +141,9 @@ class account_account(osv.osv): if context is None: context = {} pos = 0 + while pos', 'installed')]) + ids=module_obj.search(cr, uid, [('category_id', '=', 'Account Charts'), ('state', '<>', 'installed')]) res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids)] res.append((-1, 'None')) res.sort(lambda x,y: cmp(x[1],y[1])) return res + _columns = { 'name':fields.char('Name', required=True, size=64, help="Name of the fiscal year as displayed on screens."), 'code':fields.char('Code', required=True, size=64, help="Name of the fiscal year as displayed in reports."), @@ -1498,19 +1540,20 @@ class account_config_wizard(osv.osv_memory): 'name': lambda *a: time.strftime('%Y'), 'date1': lambda *a: time.strftime('%Y-01-01'), 'date2': lambda *a: time.strftime('%Y-12-31'), - 'period':lambda *a:'month' + 'period':lambda *a:'month', + 'charts': lambda *a: -1, } def action_cancel(self,cr,uid,ids,conect=None): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } def install_account_chart(self, cr, uid,ids, context=None): - for res in self.read(cr,uid,ids): + for res in self.read(cr,uid,ids): id = res['charts'] def install(id): mod_obj = self.pool.get('ir.module.module') @@ -1553,12 +1596,12 @@ class account_config_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } - + account_config_wizard() @@ -2025,7 +2068,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } @@ -2033,11 +2076,11 @@ class wizard_multi_charts_accounts(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', - } - + } + wizard_multi_charts_accounts() diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index e4ad52570b9..91ee7d094b1 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -167,8 +167,8 @@ class account_bank_statement(osv.osv): if not (abs(st.balance_end - st.balance_end_real) < 0.0001): raise osv.except_osv(_('Error !'), - _('The statement balance is incorrect !\n' - 'Check that the ending balance equals the computed one.')) + _('The statement balance is incorrect !\n') + + _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end)) if (not st.journal_id.default_credit_account_id) \ or (not st.journal_id.default_debit_account_id): raise osv.except_osv(_('Configration Error !'), @@ -177,7 +177,7 @@ class account_bank_statement(osv.osv): for line in st.move_line_ids: if line.state <> 'valid': raise osv.except_osv(_('Error !'), - _('The account entries lines are not valid.')) + _('The account entries lines are not in valid state.')) for move in st.line_ids: move_id = account_move_obj.create(cr, uid, { diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index e18c2db90de..ef78f5c4816 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -339,6 +339,17 @@ [('type','=','out_invoice')] {'type':'out_invoice'} + + + tree + + + + + form + + + New Customer Invoice @@ -421,6 +432,7 @@ Draft Customer Invoices account.invoice form + tree,form,calendar,graph [('state','=','draft'),('type','=','out_invoice')] {'type':'out_invoice'} @@ -442,6 +454,7 @@ PRO-FORMA Customer Invoices account.invoice form + tree,form,calendar,graph [('state','=','proforma'),('type','=','out_invoice')] {'type':'out_invoice'} @@ -463,6 +476,7 @@ Unpaid Customer Invoices account.invoice form + tree,form,calendar,graph [('state','!=','draft'),('reconciled','=',False),('type','=','out_invoice')] {'type':'out_invoice'} @@ -484,6 +498,7 @@ Draft Supplier Invoices account.invoice form + tree,form,calendar,graph [('state','=','draft'),('type','=','in_invoice')] {'type':'in_invoice'} @@ -505,6 +520,7 @@ Unpaid Supplier Invoices account.invoice form + tree,form,calendar,graph [('state','!=','draft'),('reconciled','=',False),('type','=','in_invoice')] {'type':'in_invoice'} @@ -526,6 +542,7 @@ Draft Customer Refunds account.invoice form + tree,form,calendar,graph [('state','=','draft'),('type','=','out_refund')] {'type':'out_refund'} @@ -547,6 +564,7 @@ Unpaid Customer Refunds account.invoice form + tree,form,calendar,graph [('state','!=','draft'),('reconciled','=',False),('type','=','out_refund')] {'type':'out_refund'} @@ -568,6 +586,7 @@ Draft Supplier Refunds account.invoice form + tree,form,calendar,graph [('state','=','draft'),('type','=','in_refund')] {'type':'in_refund'} @@ -589,6 +608,7 @@ Unpaid Supplier Refunds account.invoice form + tree,form,calendar,graph [('state','!=','draft'),('reconciled','=',False),('type','=','in_refund')] {'type':'in_refund'} diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 12f3682cf56..abade8c579c 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -305,6 +305,8 @@ class account_move_line(osv.osv): 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account'), #TODO: remove this 'amount_taxed':fields.float("Taxed Amount",digits=(16,2)), + 'parent_move_lines':fields.many2many('account.move.line', 'account_move_line_rel', 'child_id', 'parent_id', 'Parent'), + 'reconcile_implicit':fields.boolean('Implicit Reconciliaiton') } def _get_date(self, cr, uid, context): @@ -435,7 +437,11 @@ class account_move_line(osv.osv): currency = 0.0 account_id = False partner_id = False + implicit_lines = [] for line in unrec_lines: + if line.parent_move_lines: + for i in line.parent_move_lines: + implicit_lines.append(i.id) if line.state <> 'valid': raise osv.except_osv(_('Error'), _('Entry "%s" is not valid !') % line.name) @@ -481,7 +487,7 @@ class account_move_line(osv.osv): self_debit = -writeoff # If comment exist in context, take it - if context['comment']: + if 'comment' in context and context['comment']: libelle=context['comment'] else: libelle='Write-Off' @@ -531,9 +537,13 @@ class account_move_line(osv.osv): 'line_id': map(lambda x: (4,x,False), ids), 'line_partial_ids': map(lambda x: (3,x,False), ids) }) + wf_service = netsvc.LocalService("workflow") + if implicit_lines: + self.write(cr, uid, implicit_lines, {'reconcile_implicit':True,'reconcile_id':r_id}) + for id in implicit_lines: + wf_service.trg_trigger(uid, 'account.move.line', id, cr) # the id of the move.reconcile is written in the move.line (self) by the create method above # because of the way the line_id are defined: (4, x, False) - wf_service = netsvc.LocalService("workflow") for id in ids: wf_service.trg_trigger(uid, 'account.move.line', id, cr) return r_id @@ -629,7 +639,7 @@ class account_move_line(osv.osv): if raise_ex: raise osv.except_osv(_('Wrong Accounting Entry!'), _('Both Credit and Debit cannot be zero!')) - + account_obj = self.pool.get('account.account') if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!')) if update_check: diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 62cb55b13e4..104272dcaf4 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -116,19 +116,19 @@ - + - + - + /> @@ -654,6 +654,7 @@ + @@ -705,6 +706,10 @@ + + + + @@ -744,7 +749,7 @@ - + @@ -1285,6 +1290,7 @@ + @@ -1354,21 +1360,21 @@ form form new - - + + + - - + Account Configure Wizard Define Fiscal Years and Select Charts of Account open - - + + diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 5178b07eea8..45a4307a6c9 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -150,7 +150,9 @@ form - + + + @@ -238,7 +240,7 @@ # - account.analytic.journal.open.form + Entries of Open Analytic Journals account.analytic.line form tree,form diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py index 0e66d867caa..477e5262a00 100644 --- a/addons/account/project/wizard/__init__.py +++ b/addons/account/project/wizard/__init__.py @@ -34,6 +34,7 @@ import wizard_account_analytic_inverted_balance_report import wizard_account_analytic_cost_ledger_report import wizard_account_analytic_cost_ledger_for_journal_report import wizard_account_analytic_analytic_check +import wizard_account_analytic_line # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/wizard_account_analytic_line.py b/addons/account/project/wizard/wizard_account_analytic_line.py new file mode 100644 index 00000000000..143737ab153 --- /dev/null +++ b/addons/account/project/wizard/wizard_account_analytic_line.py @@ -0,0 +1,86 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# $Id$ +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import wizard +import pooler +import time + +def _action_open_window(self, cr, uid, data, context): + domain=[] + from_date= data['form']['from_date'] + to_date=data['form']['to_date'] + if from_date and to_date: + domain=[('date','>=',from_date),('date','<=',to_date)] + elif from_date: + domain=[('date','>=',from_date)] + elif to_date: + domain=[('date','<=',to_date)] + return { + 'name': 'Analytic Entries', + 'view_type': 'form', + "view_mode": 'tree,form', + 'res_model': 'account.analytic.line', + 'type': 'ir.actions.act_window', + 'domain': domain} + + +class account_analytic_line(wizard.interface): + form1 = ''' +
+ + + + + +