diff --git a/addons/account/account.py b/addons/account/account.py index 3e91214ee75..54354b4ea90 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1144,6 +1144,7 @@ class account_move(osv.osv): return amount def _centralise(self, cr, uid, move, mode, context=None): + assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection if context is None: context = {} @@ -1191,10 +1192,7 @@ class account_move(osv.osv): else: line_id2 = 0 - cr.execute('SELECT SUM(%s) '\ - 'FROM account_move_line '\ - 'WHERE move_id=%s AND id<>%s', - (mode, move.id, line_id2)) + cr.execute('SELECT SUM(%s) FROM account_move_line WHERE move_id=%%s AND id!=%%s' % (mode,), (move.id, line_id2)) result = cr.fetchone()[0] or 0.0 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id)) return True diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 6de3dabaa28..0e46944a436 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -45,7 +45,7 @@ class account_bank_statement(osv.osv): 'type': 'ir.actions.act_window', 'target': 'new', 'nodestroy': True - } + } def _default_journal_id(self, cr, uid, context={}): if context.get('journal_id', False): @@ -556,9 +556,9 @@ account_bank_statement_reconcile_line() class account_bank_statement_line(osv.osv): - def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, - context={}): + def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context={}): res = {'value': {}} + if not partner_id: return res line = self.browse(cursor, user, line_id) @@ -591,6 +591,10 @@ class account_bank_statement_line(osv.osv): balance = res_currency_obj.compute(cursor, user, company_currency_id, currency_id, balance, context=context) res['value']['amount'] = balance + + if context.get('amount', 0) > 0: + res['value']['amount'] = context.get('amount') + return res def _reconcile_amount(self, cursor, user, ids, name, args, context=None): diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index bceb1b3c857..fc10c58cc8f 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -349,11 +349,15 @@ + + - + + + @@ -363,7 +367,7 @@ - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index cf8318f1ef2..272933018ad 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -529,7 +529,6 @@ class account_move_line(osv.osv): return result def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False): - print 'XXXXXXXXXXXXXXXXXXXXXXXXXXX : ', move_id, partner_id, account_id, debit, credit, date, journal val = {} val['date_maturity'] = False @@ -791,7 +790,7 @@ class account_move_line(osv.osv): result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar, submenu=submenu) if view_type != 'tree': return result - + fld = [] fields = {} flds = [] @@ -801,12 +800,12 @@ class account_move_line(osv.osv): ids = journal_pool.search(cr, uid, []) journals = journal_pool.browse(cr, uid, ids) - all_journal = [] + all_journal = [None] for journal in journals: all_journal.append(journal.id) for field in journal.view_id.columns_id: if not field.field in fields: - fields[field.field] = [journal.id] + fields[field.field] = [None, journal.id] fld.append((field.field, field.sequence)) flds.append(field.field) else: diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index 6480178d1ae..fc622d8f0c0 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -34,7 +34,7 @@ string="Taxes Report"/>
- + - + @@ -353,9 +353,10 @@ - - - + + + + @@ -364,16 +365,18 @@ + + + + + - - - - - - - - - + + + + + + @@ -394,6 +397,24 @@ + + account.bank.statement.select + account.bank.statement + search + + + + + + + + + + + + + + account.bank.statement.tree account.bank.statement @@ -446,8 +467,8 @@ - - + + + diff --git a/addons/account_voucher_payment/account_voucher_payment_wizard.xml b/addons/account_voucher_payment/account_voucher_payment_wizard.xml deleted file mode 100644 index 0551b1bbcb5..00000000000 --- a/addons/account_voucher_payment/account_voucher_payment_wizard.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/addons/account_voucher_payment/account_voucher_unreconcile.py b/addons/account_voucher_payment/account_voucher_unreconcile.py deleted file mode 100644 index f36af98dc1c..00000000000 --- a/addons/account_voucher_payment/account_voucher_unreconcile.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). -# -# 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 wizard -import pooler - -_info_form = ''' - - - -