diff --git a/addons/account_bank_statement_extensions/__init__.py b/addons/account_bank_statement_extensions/__init__.py new file mode 100644 index 00000000000..f7e72e49c0b --- /dev/null +++ b/addons/account_bank_statement_extensions/__init__.py @@ -0,0 +1,27 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 account_bank_statement +import res_company +import res_partner_bank +import report +import wizard diff --git a/addons/account_bank_statement_extensions/__openerp__.py b/addons/account_bank_statement_extensions/__openerp__.py new file mode 100644 index 00000000000..7715a5598be --- /dev/null +++ b/addons/account_bank_statement_extensions/__openerp__.py @@ -0,0 +1,57 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 . +# +############################################################################## +{ + 'name': 'Bank Statement extensions to support e-banking', + 'version': '0.3', + 'license': 'AGPL-3', + 'author': 'Noviat', + 'category': 'Generic Modules/Accounting', + 'description': ''' +Module that extends the standard account_bank_statement_line object for improved e-banking support. + +Adds +- valuta date +- batch payments +- traceability of changes to bank statement lines +- bank statement line views +- bank statements balances report +- performance improvements for digital import of bank statement (via 'ebanking_import' context flag) +- name_search on res.partner.bank enhanced to allow search on bank and iban account numbers +- new field bank_ids on res.company to facilitate search on company banks + ''', + 'depends': ['account'], + 'demo_xml': [], + 'init_xml': [ + ], + 'update_xml' : [ + 'security/ir.model.access.csv', + 'account_bank_statement_view.xml', + 'company_view.xml', + 'account_bank_statement_report.xml', + 'wizard/confirm_statement_line_wizard.xml', + 'wizard/cancel_statement_line_wizard.xml', + 'data/account_bank_statement_extensions_data.xml', + ], + 'active': False, + 'installable': True, +} + diff --git a/addons/account_bank_statement_extensions/account_bank_statement.py b/addons/account_bank_statement_extensions/account_bank_statement.py new file mode 100644 index 00000000000..063714f48e4 --- /dev/null +++ b/addons/account_bank_statement_extensions/account_bank_statement.py @@ -0,0 +1,143 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 time +from osv import osv, fields +import decimal_precision as dp +import netsvc +from tools.translate import _ + +class account_bank_statement(osv.osv): + _inherit = 'account.bank.statement' + + def write(self, cr, uid, ids, vals, context=None): + if context is None: + context = {} + # bypass obsolete statement line resequencing + if vals.get('line_ids', False) or context.get('ebanking_import', False): + res = super(osv.osv, self).write(cr, uid, ids, vals, context=context) + else: + res = super(account_bank_statement, self).write(cr, uid, ids, vals, context=context) + return res + + def button_confirm_bank(self, cr, uid, ids, context=None): + super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, context=context) + for st in self.browse(cr, uid, ids, context=context): + cr.execute("UPDATE account_bank_statement_line \ + SET state='confirm' WHERE id in %s ", + (tuple([x.id for x in st.line_ids]),)) + return True + + def button_cancel(self, cr, uid, ids, context=None): + super(account_bank_statement, self).button_cancel(cr, uid, ids, context=context) + for st in self.browse(cr, uid, ids, context=context): + cr.execute("UPDATE account_bank_statement_line \ + SET state='draft' WHERE id in %s ", + (tuple([x.id for x in st.line_ids]),)) + return True + +account_bank_statement() + +class account_bank_statement_line_global(osv.osv): + _name = 'account.bank.statement.line.global' + _description = 'Batch Payment Info' + + _columns = { + 'name': fields.char('Communication', size=128, required=True), + 'code': fields.char('Code', size=64, required=True), + 'parent_id': fields.many2one('account.bank.statement.line.global', 'Parent Code', ondelete='cascade'), + 'child_ids': fields.one2many('account.bank.statement.line.global', 'parent_id', 'Child Codes'), + 'type': fields.selection([ + ('iso20022', 'ISO 20022'), + ('coda', 'CODA'), + ('manual', 'Manual'), + ], 'Type', required=True), + 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')), + 'bank_statement_line_ids': fields.one2many('account.bank.statement.line', 'globalisation_id', 'Bank Statement Lines'), + } + _rec_name = 'code' + _defaults = { + 'code': lambda s,c,u,ctx={}: s.pool.get('ir.sequence').get(c, u, 'account.bank.statement.line.global'), + 'name': '/', + } + _sql_constraints = [ + ('code_uniq', 'unique (code)', 'The code must be unique !'), + ] + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): + if not args: + args = [] + ids = [] + if name: + ids = self.search(cr, user, [('code', '=ilike', name)] + args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name', operator, name)] + args, limit=limit) + if not ids and len(name.split()) >= 2: + #Separating code and name for searching + operand1, operand2 = name.split(' ', 1) #name can contain spaces + ids = self.search(cr, user, [('code', '=like', operand1), ('name', operator, operand2)] + args, limit=limit) + else: + ids = self.search(cr, user, args, context=context, limit=limit) + return self.name_get(cr, user, ids, context=context) + +account_bank_statement_line_global() + +class account_bank_statement_line(osv.osv): + _inherit = 'account.bank.statement.line' + _columns = { + 'date': fields.date('Entry Date', required=True, states={'confirm': [('readonly', True)]}), + 'val_date': fields.date('Valuta Date', states={'confirm': [('readonly', True)]}), + 'globalisation_id': fields.many2one('account.bank.statement.line.global', 'Globalisation ID', + states={'confirm': [('readonly', True)]}, + help="Code to identify transactions belonging to the same globalisation level within a batch payment"), + 'globalisation_amount': fields.related('globalisation_id', 'amount', type='float', + relation='account.bank.statement.line.global', string='Glob. Amount', readonly=True), + 'journal_id': fields.related('statement_id', 'journal_id', type='many2one', relation='account.journal', string='Journal', store=True, readonly=True), + 'update_date': fields.date('Update Date', required=True, readonly=True), + 'update_by': fields.many2one('res.users', 'Updated by', required=True, readonly=True), + 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed')], + 'State', required=True, readonly=True), + 'counterparty_name': fields.char('Counterparty Name', size=35), + 'counterparty_bic': fields.char('Counterparty BIC', size=11), + 'counterparty_number': fields.char('Counterparty Number', size=34), + 'counterparty_currency': fields.char('Counterparty Currency', size=3), + } + _defaults = { + 'update_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), + 'update_by': lambda s, c, u, ctx: u, + 'state': 'draft', + } + + def unlink(self, cr, uid, ids, context=None): + if context is None: + context = {} + if context.get('block_statement_line_delete', False): + raise osv.except_osv('Warning', _('Delete operation not allowed ! \ + Please go to the associated bank statement in order to delete and/or modify this bank statement line')) + return super(account_bank_statement_line, self).unlink(cr, uid, ids, context=context) + + def write(self, cr, uid, ids, vals, context=None): + vals['update_date'] = time.strftime('%Y-%m-%d %H:%M:%S') + vals['update_by'] = uid + return super(account_bank_statement_line, self).write(cr, uid, ids, vals, context=context) + +account_bank_statement_line() diff --git a/addons/account_bank_statement_extensions/account_bank_statement_report.xml b/addons/account_bank_statement_extensions/account_bank_statement_report.xml new file mode 100644 index 00000000000..b4dafbfd9a7 --- /dev/null +++ b/addons/account_bank_statement_extensions/account_bank_statement_report.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/addons/account_bank_statement_extensions/account_bank_statement_view.xml b/addons/account_bank_statement_extensions/account_bank_statement_view.xml new file mode 100644 index 00000000000..ee6b5defb68 --- /dev/null +++ b/addons/account_bank_statement_extensions/account_bank_statement_view.xml @@ -0,0 +1,171 @@ + + + + + + + + statement.line.global.form + account.bank.statement.line.global + form + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + view.bank.statement.form.add.fields + account.bank.statement + + form + + + + + + + + + + + + + + + + + + + + + + bank.statement.line.list + account.bank.statement.line + tree + + + + + + + + + + + + + + + + + + + + + + + + + bank.statement.line.form + account.bank.statement.line + form + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + bank.statement.line.filter + account.bank.statement.line + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bank Statement Lines + account.bank.statement.line + form + tree,graph,form + {'block_statement_line_delete' : 1} + + + + + + +
+
diff --git a/addons/account_bank_statement_extensions/company_view.xml b/addons/account_bank_statement_extensions/company_view.xml new file mode 100644 index 00000000000..fd833b371cd --- /dev/null +++ b/addons/account_bank_statement_extensions/company_view.xml @@ -0,0 +1,18 @@ + + + + res.company.bank.form.inherit + res.company + + form + + + + + + + + + + + diff --git a/addons/account_bank_statement_extensions/data/account_bank_statement_extensions_data.xml b/addons/account_bank_statement_extensions/data/account_bank_statement_extensions_data.xml new file mode 100644 index 00000000000..f01afba41cd --- /dev/null +++ b/addons/account_bank_statement_extensions/data/account_bank_statement_extensions_data.xml @@ -0,0 +1,19 @@ + + + + + + + Statement Line Globalisation sequence + statement.line.global + + + Statement Line Globalisation sequence + statement.line.global + G + + + + + + diff --git a/addons/account_bank_statement_extensions/i18n/fr.po b/addons/account_bank_statement_extensions/i18n/fr.po new file mode 100644 index 00000000000..0740e697031 --- /dev/null +++ b/addons/account_bank_statement_extensions/i18n/fr.po @@ -0,0 +1,236 @@ +# French translation of OpenERP Server 6.1. +# This file contains the translation of the following modules: +# * account_bank_statement_extensions +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.1\n" +"Report-Msgid-Bugs-To: support@noviat.be\n" +"POT-Creation-Date: 2011-10-24 22:33:11.753000\n" +"PO-Revision-Date: 2011-10-24 22:33:11.753000\n" +"Last-Translator: Luc De Meyer (Noviat nv/sa)\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement Lines" +msgstr "Transactions bancaires" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement Line" +msgstr "Transaction bancaire" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Total Amount" +msgstr "Montant total" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Id" +msgstr "Id. glob." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Am." +msgstr "Mont. glob." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Amount" +msgstr "Montant glob." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Notes" +msgstr "Notes" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Search Bank Transactions" +msgstr "Recherche de transactions" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Debit" +msgstr "Debit" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Credit" +msgstr "Credit" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Debit Transactions." +msgstr "Transactions debit." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Credit Transactions." +msgstr "Transactions credit." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Extended Filters..." +msgstr "Filtres étendus..." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Group By..." +msgstr "Grouper par..." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Journal" +msgstr "Journal" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement" +msgstr "Relevé" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Fin.Account" +msgstr "Compte général" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Lvl" +msgstr "Niveau Glob." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Notes" +msgstr "Notes" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Draft" +msgstr "Brouillon" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Confirmed" +msgstr "Confirmée" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Draft Statement Lines." +msgstr "Transactions brouillon." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Confirmed Statement Lines." +msgstr "Transactions confirmées." + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_bic:0 +msgid "Counterparty BIC" +msgstr "BIC de la contrepartie" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_currency:0 +msgid "Counterparty Currency" +msgstr "Devise de la contrepartie" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_name:0 +msgid "Counterparty Name" +msgstr "Nom de la contrepartie" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_number:0 +msgid "Counterparty Number" +msgstr "No de la contrepartie" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,date:0 +msgid "Entry Date" +msgstr "Date de comptabilisation" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,globalisation_amount:0 +msgid "Glob. Amount" +msgstr "Montant glob." + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,globalisation_id:0 +msgid "Globalisation ID" +msgstr "ID de globalisation" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,journal_id:0 +msgid "Journal" +msgstr "Journal" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,val_date:0 +msgid "Valuta Date" +msgstr "Date de valeur" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,amount:0 +msgid "Amount" +msgstr "Montant" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,bank_statement_line_ids:0 +msgid "Bank Statement Lines" +msgstr "Transactions bancaires" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,child_ids:0 +msgid "Child Codes" +msgstr "Codes fils" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,code:0 +msgid "Code" +msgstr "Code" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,name:0 +msgid "Name" +msgstr "Nom" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,parent_id:0 +msgid "Parent Code" +msgstr "Code parent" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,type:0 +msgid "Type" +msgstr "Type" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "Manual" +msgstr "Manuelle" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "CODA" +msgstr "CODA" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "ISO 20022" +msgstr "ISO 20022" + +#. module: account_bank_statement_extensions +#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_bank_statement_line +msgid "Bank Statement Lines" +msgstr "Transactions bancaires" + +#. module: account_bank_statement_extensions +#: model:ir.ui.menu,name:account_bank_statement_extensions.bank_statement_line +msgid "Bank Statement Lines" +msgstr "Transactions bancaires" + diff --git a/addons/account_bank_statement_extensions/i18n/nl.po b/addons/account_bank_statement_extensions/i18n/nl.po new file mode 100644 index 00000000000..3fd64aaf40e --- /dev/null +++ b/addons/account_bank_statement_extensions/i18n/nl.po @@ -0,0 +1,236 @@ +# Dutch translation of OpenERP Server 6.1. +# This file contains the translation of the following modules: +# * account_bank_statement_extensions +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.1\n" +"Report-Msgid-Bugs-To: support@noviat.be\n" +"POT-Creation-Date: 2011-10-24 22:33:11.736000\n" +"PO-Revision-Date: 2011-10-24 22:33:11.736000\n" +"Last-Translator: Luc De Meyer (Noviat nv/sa)\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement Lines" +msgstr "Bank transacties" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement Line" +msgstr "Bank transactie" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Total Amount" +msgstr "Totaal bedrag" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Id" +msgstr "Glob. Id" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Am." +msgstr "Glob. bedrag" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Amount" +msgstr "Glob. bedrag" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Notes" +msgstr "Notities" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Search Bank Transactions" +msgstr "Transacties zoeken" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Debit" +msgstr "Debet" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Credit" +msgstr "Credit" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Debit Transactions." +msgstr "Debet transacties." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Credit Transactions." +msgstr "Credit transacties." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Extended Filters..." +msgstr "Uitgebreide filters..." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Group By..." +msgstr "Groepeer op..." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Journal" +msgstr "Dagboek" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement" +msgstr "Uitreksel" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Fin.Account" +msgstr "Grootboekrekening" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Lvl" +msgstr "Glob. niveau" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Notes" +msgstr "Notities" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Draft" +msgstr "Concept" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Confirmed" +msgstr "Bevestigd" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Draft Statement Lines." +msgstr "Concept transacties." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Confirmed Statement Lines." +msgstr "Bevestigde transacties." + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_bic:0 +msgid "Counterparty BIC" +msgstr "BIC tegenpartij" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_currency:0 +msgid "Counterparty Currency" +msgstr "Munteenheid tegenpartij" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_name:0 +msgid "Counterparty Name" +msgstr "Naam tegenpartij" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_number:0 +msgid "Counterparty Number" +msgstr "Nummer tegenpartij" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,date:0 +msgid "Entry Date" +msgstr "Boekingsdatum" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,globalisation_amount:0 +msgid "Glob. Amount" +msgstr "Glob. bedrag" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,globalisation_id:0 +msgid "Globalisation ID" +msgstr "Globalisatie ID" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,journal_id:0 +msgid "Journal" +msgstr "Dagboek" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,val_date:0 +msgid "Valuta Date" +msgstr "Valutadatum" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,amount:0 +msgid "Amount" +msgstr "Bedrag" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,bank_statement_line_ids:0 +msgid "Bank Statement Lines" +msgstr "Bank transacties" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,child_ids:0 +msgid "Child Codes" +msgstr "Subcodes" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,code:0 +msgid "Code" +msgstr "Code" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,name:0 +msgid "Name" +msgstr "Naam" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,parent_id:0 +msgid "Parent Code" +msgstr "Bovenliggende code" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,type:0 +msgid "Type" +msgstr "Type" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "Manual" +msgstr "Manueel" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "CODA" +msgstr "CODA" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "ISO 20022" +msgstr "ISO 20022" + +#. module: account_bank_statement_extensions +#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_bank_statement_line +msgid "Bank Statement Lines" +msgstr "Bank transacties" + +#. module: account_bank_statement_extensions +#: model:ir.ui.menu,name:account_bank_statement_extensions.bank_statement_line +msgid "Bank Statement Lines" +msgstr "Bank transacties" + diff --git a/addons/account_bank_statement_extensions/report/__init__.py b/addons/account_bank_statement_extensions/report/__init__.py new file mode 100644 index 00000000000..26ac2bc2df0 --- /dev/null +++ b/addons/account_bank_statement_extensions/report/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 bank_statement_balance_report diff --git a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py new file mode 100644 index 00000000000..01f9b76c681 --- /dev/null +++ b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py @@ -0,0 +1,69 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 time +from report import report_sxw +import pooler +import netsvc +logger=netsvc.Logger() + +class bank_statement_balance_report(report_sxw.rml_parse): + + def set_context(self, objects, data, ids, report_type=None): + #logger.notifyChannel('addons.'+__name__, netsvc.LOG_WARNING, 'set_context, objects = %s, data = %s, ids = %s' % (objects, data, ids)) + cr = self.cr + uid = self.uid + context = self.context + + cr.execute('SELECT s.name as s_name, s.date AS s_date, j.code as j_code, s.balance_end_real as s_balance ' \ + 'FROM account_bank_statement s ' \ + 'INNER JOIN account_journal j on s.journal_id = j.id ' \ + 'INNER JOIN ' \ + '(SELECT journal_id, max(date) as max_date FROM account_bank_statement ' \ + 'GROUP BY journal_id) d ' \ + 'ON (s.journal_id = d.journal_id AND s.date = d.max_date) ' \ + 'ORDER BY j.code') + lines = cr.dictfetchall() + + self.localcontext.update( { + 'lines': lines, + }) + super(bank_statement_balance_report, self).set_context(objects, data, ids, report_type=report_type) + + + def __init__(self, cr, uid, name, context): + if context is None: + context = {} + super(bank_statement_balance_report, self).__init__(cr, uid, name, context=context) + self.localcontext.update( { + 'time': time, + }) + self.context = context + +report_sxw.report_sxw( + 'report.bank.statement.balance.report', + 'account.bank.statement', + 'addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml', + parser=bank_statement_balance_report, + header='internal' +) + diff --git a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml new file mode 100644 index 00000000000..963b5d9dd68 --- /dev/null +++ b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ ]] + + + + + + + Bank Statement Balances Report + + + + + + + + + + + + + Name + + + Date + + + Journal + + + Closing Balance + + + + + + +
+ [[ repeatIn(lines, 'l') ]] + + + + [[ l['s_name'] ]] + + + [[ l['s_date'] ]] + + + [[ l['j_code'] ]] + + + [[ formatLang(l['s_balance']) ]] + + + + + + +
+ + + +
+
+ diff --git a/addons/account_bank_statement_extensions/res_company.py b/addons/account_bank_statement_extensions/res_company.py new file mode 100644 index 00000000000..78c88c90726 --- /dev/null +++ b/addons/account_bank_statement_extensions/res_company.py @@ -0,0 +1,36 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 . +# +############################################################################## + +from osv import osv, fields +import netsvc +from tools.translate import _ +logger=netsvc.Logger() + +class res_company(osv.osv): + _inherit = 'res.company' + _columns = { + 'bank_ids': fields.related('partner_id', 'bank_ids', type='one2many', relation='res.partner.bank', string='Company Banks'), + } + +res_company() + + diff --git a/addons/account_bank_statement_extensions/res_partner_bank.py b/addons/account_bank_statement_extensions/res_partner_bank.py new file mode 100644 index 00000000000..b6deb07022e --- /dev/null +++ b/addons/account_bank_statement_extensions/res_partner_bank.py @@ -0,0 +1,41 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 . +# +############################################################################## + +from osv import osv, fields +import netsvc +from tools.translate import _ +logger=netsvc.Logger() + +class res_partner_bank(osv.osv): + _inherit = 'res.partner.bank' + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): + if not args: + args = [] + ids = [] + if name: + ids = self.search(cr, user, [('acc_number', operator, name)] + args, limit=limit) + else: + ids = self.search(cr, user, args, context=context, limit=limit) + return self.name_get(cr, user, ids, context=context) + +res_partner_bank() diff --git a/addons/account_bank_statement_extensions/security/ir.model.access.csv b/addons/account_bank_statement_extensions/security/ir.model.access.csv new file mode 100644 index 00000000000..8bbc40ef546 --- /dev/null +++ b/addons/account_bank_statement_extensions/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_bank_statement_line_global_manager,bank.statement.line.global manager,model_account_bank_statement_line_global,account.group_account_manager,1,1,1,1 +access_bank_statement_line_global_user,bank.statement.line.global user,model_account_bank_statement_line_global,account.group_account_user,1,0,0,0 diff --git a/addons/account_bank_statement_extensions/wizard/__init__.py b/addons/account_bank_statement_extensions/wizard/__init__.py new file mode 100644 index 00000000000..c32f3d3bda9 --- /dev/null +++ b/addons/account_bank_statement_extensions/wizard/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 confirm_statement_line +import cancel_statement_line diff --git a/addons/account_bank_statement_extensions/wizard/cancel_statement_line.py b/addons/account_bank_statement_extensions/wizard/cancel_statement_line.py new file mode 100644 index 00000000000..05add83bcfa --- /dev/null +++ b/addons/account_bank_statement_extensions/wizard/cancel_statement_line.py @@ -0,0 +1,38 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# 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 time +from osv import osv, fields +import netsvc +from tools.translate import _ + +class cancel_statement_line(osv.osv_memory): + _name = 'cancel.statement.line' + _description = 'Cancel selected statement lines' + + def cancel_lines(self, cr, uid, ids, context): + line_ids = context['active_ids'] + line_obj = self.pool.get('account.bank.statement.line') + line_obj.write(cr, uid, line_ids, {'state': 'draft'}, context=context) + return {} + +cancel_statement_line() diff --git a/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml b/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml new file mode 100644 index 00000000000..a0bff7a4874 --- /dev/null +++ b/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml @@ -0,0 +1,45 @@ + + + + + + + + cancel.statement.line.form + cancel.statement.line + form + +
+