diff --git a/account_advanced_reconcile/i18n/account_advanced_reconcile.pot b/account_advanced_reconcile/i18n/account_advanced_reconcile.pot new file mode 100644 index 00000000..98382751 --- /dev/null +++ b/account_advanced_reconcile/i18n/account_advanced_reconcile.pot @@ -0,0 +1,90 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_advanced_reconcile +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 11:54+0000\n" +"PO-Revision-Date: 2014-01-21 11:54+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,partner_ids:0 +#: field:easy.reconcile.advanced.ref,partner_ids:0 +msgid "Restrict on partners" +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,account_id:0 +#: field:easy.reconcile.advanced.ref,account_id:0 +msgid "Account" +msgstr "" + +#. module: account_advanced_reconcile +#: model:ir.model,name:account_advanced_reconcile.model_account_easy_reconcile_method +msgid "reconcile method for account_easy_reconcile" +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,journal_id:0 +#: field:easy.reconcile.advanced.ref,journal_id:0 +msgid "Journal" +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,account_profit_id:0 +#: field:easy.reconcile.advanced.ref,account_profit_id:0 +msgid "Account Profit" +msgstr "" + +#. module: account_advanced_reconcile +#: view:account.easy.reconcile:0 +msgid "Match multiple debit vs multiple credit entries. Allow partial reconciliation. The lines should have the partner, the credit entry ref. is matched vs the debit entry ref. or name." +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,filter:0 +#: field:easy.reconcile.advanced.ref,filter:0 +msgid "Filter" +msgstr "" + +#. module: account_advanced_reconcile +#: view:account.easy.reconcile:0 +msgid "Advanced. Partner and Ref" +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,date_base_on:0 +#: field:easy.reconcile.advanced.ref,date_base_on:0 +msgid "Date of reconciliation" +msgstr "" + +#. module: account_advanced_reconcile +#: model:ir.model,name:account_advanced_reconcile.model_easy_reconcile_advanced +msgid "easy.reconcile.advanced" +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,account_lost_id:0 +#: field:easy.reconcile.advanced.ref,account_lost_id:0 +msgid "Account Lost" +msgstr "" + +#. module: account_advanced_reconcile +#: model:ir.model,name:account_advanced_reconcile.model_easy_reconcile_advanced_ref +msgid "easy.reconcile.advanced.ref" +msgstr "" + +#. module: account_advanced_reconcile +#: field:easy.reconcile.advanced,write_off:0 +#: field:easy.reconcile.advanced.ref,write_off:0 +msgid "Write off allowed" +msgstr "" + diff --git a/account_advanced_reconcile/i18n/fr.po b/account_advanced_reconcile/i18n/fr.po index 4a32f6a7..8986f537 100644 --- a/account_advanced_reconcile/i18n/fr.po +++ b/account_advanced_reconcile/i18n/fr.po @@ -6,15 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-04 08:25+0000\n" -"PO-Revision-Date: 2013-01-04 09:27+0100\n" -"Last-Translator: Guewen Baconnier \n" +"POT-Creation-Date: 2014-01-21 11:54+0000\n" +"PO-Revision-Date: 2014-03-21 15:24+0000\n" +"Last-Translator: Guewen Baconnier @ Camptocamp \n" "Language-Team: \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" +"X-Launchpad-Export-Date: 2014-03-22 07:11+0000\n" +"X-Generator: Launchpad (build 16967)\n" +"Language: \n" #. module: account_advanced_reconcile #: field:easy.reconcile.advanced,partner_ids:0 @@ -47,8 +48,15 @@ msgstr "Compte de produit" #. module: account_advanced_reconcile #: view:account.easy.reconcile:0 -msgid "Match multiple debit vs multiple credit entries. Allow partial reconciliation. The lines should have the partner, the credit entry ref. is matched vs the debit entry ref. or name." -msgstr "Le Lettrage peut s'effectuer sur plusieurs écritures de débit et crédit. Le Lettrage partiel est autorisé. Les écritures doivent avoir le même partenaire et la référence sur les écritures de crédit doit se retrouver dans la référence ou la description sur les écritures de débit." +msgid "" +"Match multiple debit vs multiple credit entries. Allow partial " +"reconciliation. The lines should have the partner, the credit entry ref. is " +"matched vs the debit entry ref. or name." +msgstr "" +"Le Lettrage peut s'effectuer sur plusieurs écritures de débit et crédit. Le " +"Lettrage partiel est autorisé. Les écritures doivent avoir le même " +"partenaire et la référence sur les écritures de crédit doit se retrouver " +"dans la référence ou la description sur les écritures de débit." #. module: account_advanced_reconcile #: field:easy.reconcile.advanced,filter:0 @@ -88,4 +96,3 @@ msgstr "easy.reconcile.advanced.ref" #: field:easy.reconcile.advanced.ref,write_off:0 msgid "Write off allowed" msgstr "Écart autorisé" - diff --git a/account_advanced_reconcile_transaction_ref/__openerp__.py b/account_advanced_reconcile_transaction_ref/__openerp__.py index d806ba9e..bd1586cf 100644 --- a/account_advanced_reconcile_transaction_ref/__openerp__.py +++ b/account_advanced_reconcile_transaction_ref/__openerp__.py @@ -25,7 +25,7 @@ Advanced reconciliation method for the module account_easy_reconcile Reconcile rules with transaction_ref """, - 'version': '1.0', + 'version': '1.0.1', 'author': 'Camptocamp', 'category': 'Finance', 'website': 'http://www.camptocamp.com', diff --git a/account_advanced_reconcile_transaction_ref/account.py b/account_advanced_reconcile_transaction_ref/account.py index 0525de31..b3e2cd24 100644 --- a/account_advanced_reconcile_transaction_ref/account.py +++ b/account_advanced_reconcile_transaction_ref/account.py @@ -30,7 +30,7 @@ class AccountMoveLine(Model): 'transaction_ref': fields.char('Transaction Ref.', size=128), } -class AccountBankSatement(Model): +class AccountBankStatement(Model): """ Inherit account.bank.statement class in order to set transaction_ref info on account.move.line """ @@ -43,7 +43,7 @@ class AccountBankSatement(Model): if context is None: context = {} - res = super(AccountBankSatement, self)._prepare_move_line_vals( + res = super(AccountBankStatement, self)._prepare_move_line_vals( cr, uid, st_line, move_id, debit, credit, currency_id=currency_id, amount_currency=amount_currency, diff --git a/account_advanced_reconcile_transaction_ref/i18n/account_advanced_reconcile_transaction_ref.pot b/account_advanced_reconcile_transaction_ref/i18n/account_advanced_reconcile_transaction_ref.pot new file mode 100644 index 00000000..92297c0e --- /dev/null +++ b/account_advanced_reconcile_transaction_ref/i18n/account_advanced_reconcile_transaction_ref.pot @@ -0,0 +1,97 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_advanced_reconcile_transaction_ref +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 11:55+0000\n" +"PO-Revision-Date: 2014-01-21 11:55+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,partner_ids:0 +msgid "Restrict on partners" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,account_id:0 +msgid "Account" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: view:account.easy.reconcile:0 +msgid "Advanced. Partner and Transaction Ref" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: view:account.easy.reconcile:0 +msgid "Match multiple debit vs multiple credit entries. Allow partial reconciliation. The lines should have the partner, the credit entry transaction ref. is matched vs the debit entry transaction ref. or name." +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: model:ir.model,name:account_advanced_reconcile_transaction_ref.model_easy_reconcile_advanced_transaction_ref +msgid "easy.reconcile.advanced.transaction_ref" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:account.move.line,transaction_ref:0 +msgid "Transaction Ref." +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,journal_id:0 +msgid "Journal" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,account_profit_id:0 +msgid "Account Profit" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: model:ir.model,name:account_advanced_reconcile_transaction_ref.model_account_bank_statement +msgid "Bank Statement" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,filter:0 +msgid "Filter" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: model:ir.model,name:account_advanced_reconcile_transaction_ref.model_account_easy_reconcile_method +msgid "reconcile method for account_easy_reconcile" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,date_base_on:0 +msgid "Date of reconciliation" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: model:ir.model,name:account_advanced_reconcile_transaction_ref.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: model:ir.model,name:account_advanced_reconcile_transaction_ref.model_easy_reconcile_advanced +msgid "easy.reconcile.advanced" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,account_lost_id:0 +msgid "Account Lost" +msgstr "" + +#. module: account_advanced_reconcile_transaction_ref +#: field:easy.reconcile.advanced.transaction_ref,write_off:0 +msgid "Write off allowed" +msgstr "" + diff --git a/account_advanced_reconcile_transaction_ref/i18n/fr.po b/account_advanced_reconcile_transaction_ref/i18n/fr.po index 0eb141b8..c6c26e07 100644 --- a/account_advanced_reconcile_transaction_ref/i18n/fr.po +++ b/account_advanced_reconcile_transaction_ref/i18n/fr.po @@ -6,14 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-08-13 09:37+0000\n" -"PO-Revision-Date: 2013-08-13 09:37+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2014-01-21 11:55+0000\n" +"PO-Revision-Date: 2014-03-21 15:25+0000\n" +"Last-Translator: Vincent Renaville@camptocamp " +"\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-03-22 07:11+0000\n" +"X-Generator: Launchpad (build 16967)\n" #. module: account_advanced_reconcile_transaction_ref #: field:easy.reconcile.advanced.transaction_ref,partner_ids:0 @@ -32,8 +34,16 @@ msgstr "Avancé. Partenaire et Référence de transaction" #. module: account_advanced_reconcile_transaction_ref #: view:account.easy.reconcile:0 -msgid "Match multiple debit vs multiple credit entries. Allow partial reconciliation. The lines should have the partner, the credit entry transaction ref. is matched vs the debit entry transaction ref. or name." -msgstr "Le lettrage peut s'effectuer sur plusieurs écritures de débit et crédit. Le Lettrage partiel est autorisé. Les écritures doivent avoir le même partenaire et la même référence de transaction sur les écritures de crédit doit se retrouver dans la référence de transaction ou la description sur les écritures de débit." +msgid "" +"Match multiple debit vs multiple credit entries. Allow partial " +"reconciliation. The lines should have the partner, the credit entry " +"transaction ref. is matched vs the debit entry transaction ref. or name." +msgstr "" +"Le lettrage peut s'effectuer sur plusieurs écritures de débit et crédit. Le " +"Lettrage partiel est autorisé. Les écritures doivent avoir le même " +"partenaire et la même référence de transaction sur les écritures de crédit " +"doit se retrouver dans la référence de transaction ou la description sur les " +"écritures de débit." #. module: account_advanced_reconcile_transaction_ref #: model:ir.model,name:account_advanced_reconcile_transaction_ref.model_easy_reconcile_advanced_transaction_ref @@ -94,4 +104,3 @@ msgstr "Compte de charge" #: field:easy.reconcile.advanced.transaction_ref,write_off:0 msgid "Write off allowed" msgstr "Ecart autorisé" - diff --git a/account_easy_reconcile/__openerp__.py b/account_easy_reconcile/__openerp__.py index a3f22d54..a53662c5 100755 --- a/account_easy_reconcile/__openerp__.py +++ b/account_easy_reconcile/__openerp__.py @@ -21,7 +21,7 @@ { "name": "Easy Reconcile", - "version": "1.3.0", + "version": "1.3.1", "depends": ["account"], "author": "Akretion,Camptocamp", "description": """ diff --git a/account_easy_reconcile/easy_reconcile.py b/account_easy_reconcile/easy_reconcile.py index 7971895e..dfe74da7 100644 --- a/account_easy_reconcile/easy_reconcile.py +++ b/account_easy_reconcile/easy_reconcile.py @@ -22,6 +22,7 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT +from openerp.tools.translate import _ class easy_reconcile_options(orm.AbstractModel): @@ -257,6 +258,58 @@ class account_easy_reconcile(orm.Model): _('Error'), _('There is no history of reconciled ' 'items on the task: %s.') % rec.name) + + def _open_move_line_list(sefl, cr, uid, move_line_ids, name, context=None): + return { + 'name': name, + 'view_mode': 'tree,form', + 'view_id': False, + 'view_type': 'form', + 'res_model': 'account.move.line', + 'type': 'ir.actions.act_window', + 'nodestroy': True, + 'target': 'current', + 'domain': unicode([('id', 'in', move_line_ids)]), + } + + def open_unreconcile(self, cr, uid, ids, context=None): + """ Open the view of move line with the unreconciled move lines + """ + + assert len(ids) == 1 , \ + "You can only open entries from one profile at a time" + + obj_move_line = self.pool.get('account.move.line') + res = {} + for task in self.browse(cr, uid, ids, context=context): + line_ids = obj_move_line.search( + cr, uid, + [('account_id', '=', task.account.id), + ('reconcile_id', '=', False), + ('reconcile_partial_id', '=', False)], + context=context) + + name = _('Unreconciled items') + return self._open_move_line_list(cr, uid, line_ids, name, context=context) + + def open_partial_reconcile(self, cr, uid, ids, context=None): + """ Open the view of move line with the unreconciled move lines + """ + + assert len(ids) == 1 , \ + "You can only open entries from one profile at a time" + + obj_move_line = self.pool.get('account.move.line') + res = {} + for task in self.browse(cr, uid, ids, context=context): + line_ids = obj_move_line.search( + cr, uid, + [('account_id', '=', task.account.id), + ('reconcile_id', '=', False), + ('reconcile_partial_id', '!=', False)], + context=context) + name = _('Partial reconciled items') + return self._open_move_line_list(cr, uid, line_ids, name, context=context) def last_history_reconcile(self, cr, uid, rec_id, context=None): """ Get the last history record for this reconciliation profile diff --git a/account_easy_reconcile/easy_reconcile.xml b/account_easy_reconcile/easy_reconcile.xml index 2696419a..56e12b2e 100644 --- a/account_easy_reconcile/easy_reconcile.xml +++ b/account_easy_reconcile/easy_reconcile.xml @@ -13,11 +13,9 @@ + + + + + diff --git a/account_statement_ofx_import/__init__.py b/account_statement_ofx_import/__init__.py new file mode 100644 index 00000000..19462c05 --- /dev/null +++ b/account_statement_ofx_import/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Pedro Manuel Baeza Romero +# Copyright 2013 Servicios Tecnológicos Avanzados +# +# 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 statement +import parser diff --git a/account_statement_ofx_import/__openerp__.py b/account_statement_ofx_import/__openerp__.py new file mode 100644 index 00000000..a67c8c81 --- /dev/null +++ b/account_statement_ofx_import/__openerp__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Pedro Manuel Baeza Romero +# Copyright 2013 Servicios Tecnológicos Avanzados +# Financed by AB Internet (http://www.abinternet.co.uk/) +# +# 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 OFX import", + 'version': '1.0', + 'author': 'Servicios Tecnológicos Avanzados - Pedro M. Baeza', + 'maintainer': 'Pedro M. Baeza', + 'category': 'Finance', + 'complexity': 'normal', + 'depends': [ + 'account_statement_base_import', + ], + 'external_dependencies': { + 'python': ['ofxparse'], + }, + 'description': """ + Allows to import OFX (Open Financial Exchange) statement files, using + *account_statement_base_import* generic inheritance mechanism to import + statements. + + It requires ofxparse library to work. + """, + 'website': 'http://www.serviciosbaeza.com', + 'data': [], + 'test': [], + 'installable': True, + 'images': [], + 'auto_install': False, + 'license': 'AGPL-3', +} diff --git a/account_statement_ofx_import/i18n/account_statement_ofx_import.pot b/account_statement_ofx_import/i18n/account_statement_ofx_import.pot new file mode 100644 index 00000000..e2aedabf --- /dev/null +++ b/account_statement_ofx_import/i18n/account_statement_ofx_import.pot @@ -0,0 +1,34 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_statement_ofx_import +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:05+0000\n" +"PO-Revision-Date: 2014-01-21 12:05+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_statement_ofx_import +#: code:addons/account_statement_ofx_import/statement.py:34 +#, python-format +msgid "OFX - Open Financial Exchange" +msgstr "" + +#. module: account_statement_ofx_import +#: code:addons/account_statement_ofx_import/parser/ofx_parser.py:29 +#, python-format +msgid "Please install python lib ofxparse" +msgstr "" + +#. module: account_statement_ofx_import +#: model:ir.model,name:account_statement_ofx_import.model_account_statement_profile +msgid "Statement Profile" +msgstr "" + diff --git a/account_statement_ofx_import/parser/__init__.py b/account_statement_ofx_import/parser/__init__.py new file mode 100644 index 00000000..682e6db7 --- /dev/null +++ b/account_statement_ofx_import/parser/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Pedro Manuel Baeza Romero +# Copyright 2013 Servicios Tecnológicos Avanzados +# +# 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 . import ofx_parser + diff --git a/account_statement_ofx_import/parser/ofx_parser.py b/account_statement_ofx_import/parser/ofx_parser.py new file mode 100644 index 00000000..65961241 --- /dev/null +++ b/account_statement_ofx_import/parser/ofx_parser.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Pedro Manuel Baeza Romero +# Copyright 2013 Servicios Tecnológicos Avanzados +# +# 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 openerp.tools.translate import _ +from account_statement_base_import.parser import BankStatementImportParser +import tempfile +import datetime + +try: + import ofxparse +except: + raise Exception(_('Please install python lib ofxparse')) + +class OfxParser(BankStatementImportParser): + """ + Class for defining parser for OFX file format. + """ + + def __init__(self, parser_name, *args, **kwargs): + """ + """ + super(OfxParser, self).__init__(parser_name, *args, **kwargs) + + @classmethod + def parser_for(cls, parser_name): + """ + Used by the new_bank_statement_parser class factory. Return true if + the providen name is 'ofx_so'. + """ + return parser_name == 'ofx_so' + + def _custom_format(self, *args, **kwargs): + """ + No other work on data are needed in this parser. + """ + return True + + def _pre(self, *args, **kwargs): + """ + No pre-treatment needed for this parser. + """ + return True + + def _parse(self, *args, **kwargs): + """ + Launch the parsing itself. + """ + ofx_file = tempfile.NamedTemporaryFile() + ofx_file.seek(0) + ofx_file.write(self.filebuffer) + ofx_file.flush() + ofx = ofxparse.OfxParser.parse(file(ofx_file.name)) + ofx_file.close() + res = [] + for transaction in ofx.account.statement.transactions: + res.append({ + 'date': transaction.date, + 'amount': transaction.amount, + 'ref': transaction.type, + 'label': transaction.payee, + }) + self.result_row_list = res + return True + + def _validate(self, *args, **kwargs): + """ + Nothing to do here. ofxparse trigger possible format errors. + """ + return True + + def _post(self, *args, **kwargs): + """ + Nothing is needed to do after parsing. + """ + return True + + def _post(self, *args, **kwargs): + """ + Nothing to do. + """ + return True + + def get_st_line_vals(self, line, *args, **kwargs): + """ + This method must return a dict of vals that can be passed to create + method of statement line in order to record it. It is the + responsibility of every parser to give this dict of vals, so each one + can implement his own way of recording the lines. + :param: line: a dict of vals that represent a line of + result_row_list + :return: dict of values to give to the create method of statement + line + """ + return { + 'name': line.get('label', line.get('ref', '/')), + 'date': line.get('date', datetime.datetime.now().date()), + 'amount': line.get('amount', 0.0), + 'ref': line.get('ref', '/'), + 'label': line.get('label', ''), + } + diff --git a/account_statement_ofx_import/statement.py b/account_statement_ofx_import/statement.py new file mode 100644 index 00000000..15060360 --- /dev/null +++ b/account_statement_ofx_import/statement.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Pedro Manuel Baeza Romero +# Copyright 2013 Servicios Tecnológicos Avanzados +# +# 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 openerp.tools.translate import _ +from openerp.osv import fields, orm + +class AccountStatementProfil(orm.Model): + _inherit = "account.statement.profile" + + def get_import_type_selection(self, cr, uid, context=None): + """ + Inherited from parent to add parser. + """ + selection = super(AccountStatementProfil, self + ).get_import_type_selection(cr, uid, + context=context) + selection.append(('ofx_so', _('OFX - Open Financial Exchange'))) + return selection diff --git a/account_statement_one_move/__init__.py b/account_statement_one_move/__init__.py new file mode 100644 index 00000000..141c95fc --- /dev/null +++ b/account_statement_one_move/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# account_statement_one_move for OpenERP +# Copyright (C) 2013-TODAY Akretion . +# @author Sébastien BEAU +# +# 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 . import statement diff --git a/account_statement_one_move/__openerp__.py b/account_statement_one_move/__openerp__.py new file mode 100644 index 00000000..ed9275ab --- /dev/null +++ b/account_statement_one_move/__openerp__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# account_statement_one_move for OpenERP +# Copyright (C) 2013-TODAY Akretion . +# @author Sébastien BEAU +# +# 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 one move', + 'version': '0.1', + 'category': 'Generic Modules/Others', + 'license': 'AGPL-3', + 'description': """ + This module allows to group all lines of a bank statement in only one move. + This feature is optional and can be activated with a checkbox in the bank + statement's profile. This is very useful for credit card deposit for + example, you won't have a move for each line. + + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com/', + 'depends': ['account_statement_ext'], + 'data': [ + 'statement_view.xml' + ], + 'demo': [], + 'installable': True, + 'auto_install': False, + 'active': False, +} diff --git a/account_statement_one_move/statement.py b/account_statement_one_move/statement.py new file mode 100644 index 00000000..c16698ec --- /dev/null +++ b/account_statement_one_move/statement.py @@ -0,0 +1,225 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# account_statement_one_move for OpenERP +# Copyright (C) 2013-TODAY Akretion . +# @author Sébastien BEAU +# +# 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 openerp.osv import fields, orm, osv + + +class AccountStatementProfile(orm.Model): + _inherit = "account.statement.profile" + _columns = { + 'one_move': fields.boolean( + 'Group Journal Items', + help="Only one Journal Entry will be generated on the " + "validation of the bank statement."), + 'split_transfer_line': fields.boolean( + 'Split Transfer Line', + help="Two transfer lines will be automatically generated : one " + "for the refunds and one for the payments.") + } + +class account_bank_statement(orm.Model): + _inherit = "account.bank.statement" + + def _prepare_move_line_vals(self, cr, uid, st_line, *args, **kwargs): + res = super(account_bank_statement, self)._prepare_move_line_vals(cr, uid, st_line, + *args, **kwargs) + period_id = self._get_period(cr, uid, st_line.statement_id.date, + context=kwargs.get('context')) + if st_line.statement_id.profile_id.one_move: + res.update({ + 'period_id': period_id, + 'date': st_line.statement_id.date, + 'name': st_line.ref, + }) + return res + + + return res + + def _prepare_move(self, cr, uid, st_line, st_line_number, context=None): + res = super(account_bank_statement, self).\ + _prepare_move(cr, uid, st_line, st_line_number, context=context) + res.update({ + 'ref': st_line.statement_id.name, + 'name': st_line.statement_id.name, + 'date': st_line.statement_id.date, + }) + return res + + + def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, + st_line_number, context=None): + if context is None: + context = {} + context['from_parent_object'] = True #For compability with module account_constraints + account_move_obj = self.pool.get('account.move') + account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') + st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, + context=context) + st = st_line.statement_id + + if st.profile_id.one_move: + if not context.get('move_id'): + move_vals = self._prepare_move(cr, uid, st_line, st_line_number, context=context) + context['move_id'] = account_move_obj.create(cr, uid, move_vals, context=context) + self.create_move_line_from_st_line(cr, uid, context['move_id'], + st_line_id, company_currency_id, + context=context) + return context['move_id'] + else: + return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line_id, + company_currency_id, + st_line_number, + context=context) + + def create_move_line_from_st_line(self, cr, uid, move_id, st_line_id, + company_currency_id, context=None): + """Create the account move line from the statement line. + + :param int/long move_id: ID of the account.move + :param int/long st_line_id: ID of the account.bank.statement.line to create the move line from. + :param int/long company_currency_id: ID of the res.currency of the company + :return: ID of the account.move created + """ + if context is None: + context = {} + res_currency_obj = self.pool.get('res.currency') + account_move_line_obj = self.pool.get('account.move.line') + account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') + st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context=context) + st = st_line.statement_id + + context.update({'date': st_line.date}) + acc_cur = ((st_line.amount<=0) and st.journal_id.default_debit_account_id) or st_line.account_id + + context.update({ + 'res.currency.compute.account': acc_cur, + }) + amount = res_currency_obj.compute(cr, uid, st.currency.id, + company_currency_id, + st_line.amount, + context=context) + + bank_move_vals = self._prepare_bank_move_line(cr, uid, st_line, move_id, amount, + company_currency_id, context=context) + return account_move_line_obj.create(cr, uid, bank_move_vals, context=context) + + def _valid_move(self, cr, uid, move_id, context=None): + move_obj = self.pool.get('account.move') + move = move_obj.browse(cr, uid, move_id, context=context) + move_obj.post(cr, uid, [move_id], context=context) + return True + + + def _prepare_transfer_move_line_vals(self, cr, uid, st, name, amount, move_id, context=None): + """ + Prepare the dict of values to create the transfer move lines. + """ + account_id = st.profile_id.journal_id.default_debit_account_id.id + partner_id = st.profile_id.partner_id and profile.partner_id.id or False + if amount < 0.0: + debit = 0.0 + credit = -amount + else: + debit = amount + credit = 0.0 + vals = { + 'name': name, + 'date': st.date, + 'partner_id': partner_id, + 'statement_id': st.id, + 'account_id': account_id, + 'ref': name, + 'move_id': move_id, + 'credit': credit, + 'debit': debit, + 'journal_id': st.journal_id.id, + 'period_id': st.period_id.id, + } + return vals + + + def create_move_transfer_lines(self, cr, uid, move, st, context=None): + move_line_obj = self.pool.get('account.move.line') + move_id = move.id + refund = 0.0 + payment = 0.0 + transfer_lines = [] + transfer_line_ids = [] + #Calculate the part of the refund amount and the payment amount + for move_line in move.line_id: + refund -= move_line.debit + payment += move_line.credit + #Create 2 Transfer lines or One global tranfer line + if st.profile_id.split_transfer_line: + if refund: + transfer_lines.append(['Refund Transfer', refund]) + if payment: + transfer_lines.append(['Payment Transfer', payment]) + else: + amount = payment + refund + if amount: + transfer_lines.append(['Transfer', amount]) + for transfer_line in transfer_lines: + vals = self._prepare_transfer_move_line_vals(cr, uid, st, + transfer_line[0], + transfer_line[1], + move_id, + context=context) + transfer_line_ids.append(move_line_obj.create(cr, uid, vals, context=context)) + return transfer_line_ids + + + def button_confirm_bank(self, cr, uid, ids, context=None): + st_line_obj = self.pool.get('account.bank.statement.line') + move_obj = self.pool.get('account.move') + if context is None: + context = {} + for st in self.browse(cr, uid, ids, context=context): + super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, + context=context) + if st.profile_id.one_move and context.get('move_id', False): + move_id = context['move_id'] + move = move_obj.browse(cr, uid, move_id, context=context) + transfe_line_ids = self.create_move_transfer_lines(cr, uid, move, st, context=context) + self._valid_move(cr, uid, move_id, context=context) + lines_ids = [x.id for x in st.line_ids] + st_line_obj.write(cr, uid, lines_ids, + {'move_ids': [(4, move_id, False)]}, + context=context) + return True + + def button_cancel(self, cr, uid, ids, context=None): + done = [] + for st in self.browse(cr, uid, ids, context=context): + if st.profile_id.one_move and st.line_ids: + for move in st.line_ids[0].move_ids: + if move.state != 'draft': + move.button_cancel(context=context) + move.unlink(context=context) + st.write({'state':'draft'}, context=context) + else: + super(account_bank_statement, self).button_cancel(cr, uid, ids, + context=context) + return True + + diff --git a/account_statement_one_move/statement_view.xml b/account_statement_one_move/statement_view.xml new file mode 100644 index 00000000..e0e19fc8 --- /dev/null +++ b/account_statement_one_move/statement_view.xml @@ -0,0 +1,26 @@ + + + + + + + + + + account_statement_one_move.account_statement.view_form + account.statement.profile + + + + + + + + + + + diff --git a/account_statement_regex_account_completion/__init__.py b/account_statement_regex_account_completion/__init__.py new file mode 100644 index 00000000..41101e40 --- /dev/null +++ b/account_statement_regex_account_completion/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laetitia Gangloff +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# All Rights Reserved +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility 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 +# guarantees and support are strongly advised to contact a Free Software +# Service Company. +# +# 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 . import statement + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_statement_regex_account_completion/__openerp__.py b/account_statement_regex_account_completion/__openerp__.py new file mode 100644 index 00000000..9acb1940 --- /dev/null +++ b/account_statement_regex_account_completion/__openerp__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laetitia Gangloff +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# All Rights Reserved +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility 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 +# guarantees and support are strongly advised to contact a Free Software +# Service Company. +# +# 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": "Account Statement Regex Account Completion addon", + "version": "0.1", + "author": "ACSONE SA/NV", + "category": "Other", + "website": "http://www.acsone.eu", + "depends": ["account_statement_base_completion", + ], + "description": """ + +Account Statement Regex Account Completion addon +========================= + +- Add a completion method based on a specified regular expression + and update account to use in the bank statement line with the specified account. +""", + "data": ['statement_view.xml', + ], + "demo": [], + "test": [], + "active": False, + "license": "AGPL-3", + "installable": True, + "auto_install": False, + "application": False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_statement_regex_account_completion/i18n/account_statement_regex_account_completion.pot b/account_statement_regex_account_completion/i18n/account_statement_regex_account_completion.pot new file mode 100644 index 00000000..42587093 --- /dev/null +++ b/account_statement_regex_account_completion/i18n/account_statement_regex_account_completion.pot @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_statement_regex_account_completion +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-22 10:59+0000\n" +"PO-Revision-Date: 2014-01-22 10:59+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_statement_regex_account_completion +#: field:account.statement.completion.rule,regex:0 +msgid "Regular Expression" +msgstr "" + +#. module: account_statement_regex_account_completion +#: field:account.statement.completion.rule,account_id:0 +msgid "Account to set" +msgstr "" + +#. module: account_statement_regex_account_completion +#: model:ir.model,name:account_statement_regex_account_completion.model_account_statement_completion_rule +msgid "account.statement.completion.rule" +msgstr "" + diff --git a/account_statement_regex_account_completion/i18n/fr.po b/account_statement_regex_account_completion/i18n/fr.po new file mode 100644 index 00000000..d8d96513 --- /dev/null +++ b/account_statement_regex_account_completion/i18n/fr.po @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_statement_regex_account_completion +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-22 10:59+0000\n" +"PO-Revision-Date: 2014-01-23 17:42+0000\n" +"Last-Translator: Laetitia Gangloff (Acsone) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-03-14 07:02+0000\n" +"X-Generator: Launchpad (build 16963)\n" + +#. module: account_statement_regex_account_completion +#: field:account.statement.completion.rule,regex:0 +msgid "Regular Expression" +msgstr "Expression Régulière" + +#. module: account_statement_regex_account_completion +#: field:account.statement.completion.rule,account_id:0 +msgid "Account to set" +msgstr "Compte à utiliser" + +#. module: account_statement_regex_account_completion +#: model:ir.model,name:account_statement_regex_account_completion.model_account_statement_completion_rule +msgid "account.statement.completion.rule" +msgstr "account.statement.completion.rule" diff --git a/account_statement_regex_account_completion/statement.py b/account_statement_regex_account_completion/statement.py new file mode 100644 index 00000000..e54f136e --- /dev/null +++ b/account_statement_regex_account_completion/statement.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laetitia Gangloff +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# All Rights Reserved +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility 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 +# guarantees and support are strongly advised to contact a Free Software +# Service Company. +# +# 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 openerp.osv.orm import Model +from openerp.osv import fields + +import re + + +class AccountStatementCompletionRule(Model): + """Add a rule to complete account based on a regular expression""" + + _inherit = "account.statement.completion.rule" + + def _get_functions(self, cr, uid, context=None): + res = super(AccountStatementCompletionRule, self)._get_functions( + cr, uid, context=context) + res.append(('set_account', + 'Set account for line labels matching a regular expression')) + return res + + _columns = { + 'function_to_call': fields.selection(_get_functions, 'Method'), + 'regex': fields.char('Regular Expression', size=128), + 'account_id': fields.many2one('account.account', string="Account to set"), + } + + def set_account(self, cr, uid, id, st_line, context=None): + """ + If line name match regex, update account_id + Then, call the generic st_line method to complete other values. + :param dict st_line: read of the concerned account.bank.statement.line + :return: + A dict of value that can be passed directly to the write method of + the statement line or {} + {'partner_id': value, + 'account_id' : value, + ...} + """ + name = st_line['name'] + res = {} + if name: + rule = self.browse(cr, uid, id, context=context) + if re.match(rule.regex, name): + res['account_id'] = rule.account_id.id + return res + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_statement_regex_account_completion/statement_view.xml b/account_statement_regex_account_completion/statement_view.xml new file mode 100644 index 00000000..2dd4e204 --- /dev/null +++ b/account_statement_regex_account_completion/statement_view.xml @@ -0,0 +1,21 @@ + + + + + + account.statement.completion.rule.view (account_statement_regex_account_completion) + account.statement.completion.rule + + form + + + + + + + + + + + + diff --git a/account_statement_regex_account_completion/tests/__init__.py b/account_statement_regex_account_completion/tests/__init__.py new file mode 100644 index 00000000..826f535a --- /dev/null +++ b/account_statement_regex_account_completion/tests/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laetitia Gangloff +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# All Rights Reserved +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility 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 +# guarantees and support are strongly advised to contact a Free Software +# Service Company. +# +# 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 . import test_regex_account_completion + +checks = [ + test_regex_account_completion +] + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_statement_regex_account_completion/tests/test_regex_account_completion.py b/account_statement_regex_account_completion/tests/test_regex_account_completion.py new file mode 100644 index 00000000..64958844 --- /dev/null +++ b/account_statement_regex_account_completion/tests/test_regex_account_completion.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laetitia Gangloff +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# All Rights Reserved +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility 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 +# guarantees and support are strongly advised to contact a Free Software +# Service Company. +# +# 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 openerp.tests import common +import time + +ACC_NUMBER = "BE38733040385372" + + +class test_regex_account_completion(common.TransactionCase): + + def prepare(self): + self.account_bank_statement_obj = self.registry("account.bank.statement") + self.account_bank_statement_line_obj = self.registry("account.bank.statement.line") + self.account_id = self.ref('account.a_expense') + # create the completion rule + rule_vals = {'function_to_call': 'set_account', + 'regex': '^My statement', + 'account_id': self.account_id} + completion_rule_id = self.registry("account.statement.completion.rule").create(self.cr, self.uid, rule_vals) + + # Create the profile + journal_id = self.ref("account.bank_journal") + profile_id = self.registry("account.statement.profile").create(self.cr, self.uid, { + "name": "TEST", + "commission_account_id": self.ref("account.a_recv"), + "journal_id": journal_id, + "rule_ids": [(6, 0, [completion_rule_id])]}) + + # Create a bank statement + self.statement_id = self.account_bank_statement_obj.create(self.cr, self.uid, { + "balance_end_real": 0.0, + "balance_start": 0.0, + "date": time.strftime('%Y-%m-%d'), + "journal_id": journal_id, + "profile_id": profile_id + }) + + # Create two bank statement lines + self.statement_line1_id = self.account_bank_statement_line_obj.create(self.cr, self.uid, { + 'amount': 1000.0, + 'name': 'My statement', + 'ref': 'My ref', + 'statement_id': self.statement_id, + 'partner_acc_number': ACC_NUMBER + }) + + self.statement_line2_id = self.account_bank_statement_line_obj.create(self.cr, self.uid, { + 'amount': 2000.0, + 'name': 'My second statement', + 'ref': 'My second ref', + 'statement_id': self.statement_id, + 'partner_acc_number': ACC_NUMBER + }) + + def test_00(self): + """Test the automatic completion on account + """ + self.prepare() + statement_obj = self.account_bank_statement_obj.browse(self.cr, self.uid, self.statement_id) + statement_obj.button_auto_completion() + statement_line1 = self.account_bank_statement_line_obj.browse(self.cr, self.uid, self.statement_line1_id) + self.assertEquals(self.account_id, statement_line1.account_id.id, "The account should be the account of the completion") + statement_line2 = self.account_bank_statement_line_obj.browse(self.cr, self.uid, self.statement_line2_id) + self.assertNotEqual(self.account_id, statement_line2.account_id.id, "The account should be not the account of the completion") diff --git a/account_statement_so_completion/__init__.py b/account_statement_so_completion/__init__.py new file mode 100644 index 00000000..34a7ad21 --- /dev/null +++ b/account_statement_so_completion/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Joel Grand-Guillaume +# Copyright 2011-2012 Camptocamp SA +# # +# Author: Leonardo Pistone # +# Copyright 2013 Camptocamp SA # +# # +# 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 . import statement diff --git a/account_statement_so_completion/__openerp__.py b/account_statement_so_completion/__openerp__.py new file mode 100644 index 00000000..30a7f581 --- /dev/null +++ b/account_statement_so_completion/__openerp__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Joel Grand-Guillaume +# Copyright 2011-2012 Camptocamp SA +# # +# Author: Leonardo Pistone # +# Copyright 2013 Camptocamp SA # +# # +# 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 Sale Order completion", + 'version': '0.1', + 'author': 'Camptocamp', + 'maintainer': 'Camptocamp', + 'category': 'Finance', + 'complexity': 'easy', + 'depends': ['account_statement_base_completion', 'sale'], + 'description': """ + This module improve the module account_statement_base_completion to add + support for completion rules based on Sale Orders. This was initially part of + the module account_statement_base_completion, but is now separate to keep + dependencies separate. + + This module provides the following rule: + + 1) Match from statement line reference (based on SO number) +""", + 'website': 'http://www.camptocamp.com', + 'data': [ + 'data.xml', + ], + 'test': [ + 'test/completion_so_test.yml'], + 'installable': True, + 'images': [], + 'auto_install': True, + 'license': 'AGPL-3', + } diff --git a/account_statement_so_completion/data.xml b/account_statement_so_completion/data.xml new file mode 100644 index 00000000..89fedef2 --- /dev/null +++ b/account_statement_so_completion/data.xml @@ -0,0 +1,12 @@ + + + + + + Match from line reference (based on SO number) + 50 + get_from_ref_and_so + + + + diff --git a/account_statement_so_completion/i18n/account_statement_so_completion.pot b/account_statement_so_completion/i18n/account_statement_so_completion.pot new file mode 100644 index 00000000..69bf8c28 --- /dev/null +++ b/account_statement_so_completion/i18n/account_statement_so_completion.pot @@ -0,0 +1,28 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_statement_so_completion +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:04+0000\n" +"PO-Revision-Date: 2014-01-21 12:04+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_statement_so_completion +#: code:addons/account_statement_so_completion/statement.py:77 +#, python-format +msgid "Line named \"%s\" (Ref:%s) was matched by more than one partner while looking on SO by ref." +msgstr "" + +#. module: account_statement_so_completion +#: model:ir.model,name:account_statement_so_completion.model_account_statement_completion_rule +msgid "account.statement.completion.rule" +msgstr "" + diff --git a/account_statement_so_completion/statement.py b/account_statement_so_completion/statement.py new file mode 100644 index 00000000..dcf2378f --- /dev/null +++ b/account_statement_so_completion/statement.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Joel Grand-Guillaume # +# Copyright 2011-2012 Camptocamp SA # +# # +# Author: Leonardo Pistone # +# Copyright 2013 Camptocamp SA # +# # +# 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 openerp.osv import fields, orm +from tools.translate import _ + +from openerp.addons.account_statement_base_completion.statement import ErrorTooManyPartner + + +class account_statement_completion_rule(orm.Model): + + _name = "account.statement.completion.rule" + _inherit = "account.statement.completion.rule" + + def _get_functions(self, cr, uid, context=None): + res = super(account_statement_completion_rule, self)._get_functions( + cr, uid, context=context) + res.append( + ('get_from_ref_and_so', 'From line reference (based on SO number)') + ) + return res + + # Should be private but data are initialised with no update XML + def get_from_ref_and_so(self, cr, uid, st_line, context=None): + """ + Match the partner based on the SO number and the reference of the + statement line. Then, call the generic get_values_for_line method to + complete other values. If more than one partner matched, raise the + ErrorTooManyPartner error. + + :param int/long st_line: read of the concerned + account.bank.statement.line + + :return: + A dict of value that can be passed directly to the write method of + the statement line or {} + {'partner_id': value, + 'account_id': value, + + ...} + """ + st_obj = self.pool.get('account.bank.statement.line') + res = {} + if st_line: + so_obj = self.pool.get('sale.order') + so_id = so_obj.search(cr, + uid, + [('name', '=', st_line['ref'])], + context=context) + if so_id: + if so_id and len(so_id) == 1: + so = so_obj.browse(cr, uid, so_id[0], context=context) + res['partner_id'] = so.partner_id.id + elif so_id and len(so_id) > 1: + raise ErrorTooManyPartner( + _('Line named "%s" (Ref:%s) was matched by more ' + 'than one partner while looking on SO by ref.') % + (st_line['name'], st_line['ref'])) + st_vals = st_obj.get_values_for_line( + cr, + uid, + profile_id=st_line['profile_id'], + master_account_id=st_line['master_account_id'], + partner_id=res.get('partner_id', False), + line_type='customer', + amount=st_line['amount'] if st_line['amount'] else 0.0, + context=context) + res.update(st_vals) + return res + + _columns = { + 'function_to_call': fields.selection(_get_functions, 'Method'), + } diff --git a/account_statement_so_completion/test/completion_so_test.yml b/account_statement_so_completion/test/completion_so_test.yml new file mode 100644 index 00000000..3b0bda3f --- /dev/null +++ b/account_statement_so_completion/test/completion_so_test.yml @@ -0,0 +1,44 @@ +- + In order to test the banking framework for Sale Orders, I first need to + create a profile +- + !record {model: account.statement.profile, id: profile_test_so}: + name: Bank EUR Profile for SO + journal_id: account.bank_journal + commission_account_id: account.a_expense + company_id: base.main_company + balance_check: True + rule_ids: + - account_statement_base_completion.bank_statement_completion_rule_4 + - account_statement_base_completion.bank_statement_completion_rule_5 + - account_statement_base_completion.bank_statement_completion_rule_2 + - account_statement_base_completion.bank_statement_completion_rule_3 + - bank_statement_completion_rule_1 +- + Now I create a statement. I create statment lines separately because I need + to find each one by XML id +- + !record {model: account.bank.statement, id: statement_test_sale1}: + name: Statement for SO + profile_id: profile_test_so + company_id: base.main_company +- + I create a statement line for a SO +- + !record {model: account.bank.statement.line, id: statement_line_so}: + name: Test autocompletion based on Sale Order Number + statement_id: statement_test_sale1 + ref: SO007 + date: '2013-12-20' + amount: 14981.0 +- + I run the auto complete +- + !python {model: account.bank.statement}: | + result = self.button_auto_completion(cr, uid, [ref("statement_test_sale1")]) +- + Now I can check that all is nice and shiny, line 1. I expect the Sale Order + Number to be recognised. +- + !assert {model: account.bank.statement.line, id: statement_line_so, string: Check completion by SO number}: + - partner_id.name == u'Luminous Technologies' diff --git a/account_statement_transactionid_completion/__openerp__.py b/account_statement_transactionid_completion/__openerp__.py index d8c20ea3..46513591 100644 --- a/account_statement_transactionid_completion/__openerp__.py +++ b/account_statement_transactionid_completion/__openerp__.py @@ -48,7 +48,10 @@ "data.xml", ], 'demo_xml': [], - 'test': [], + 'test': [ + 'test/sale.yml', + 'test/completion_transactionid_test.yml', + ], 'installable': True, 'images': [], 'auto_install': True, diff --git a/account_statement_transactionid_completion/i18n/account_statement_transactionid_completion.pot b/account_statement_transactionid_completion/i18n/account_statement_transactionid_completion.pot new file mode 100644 index 00000000..ac5f9b13 --- /dev/null +++ b/account_statement_transactionid_completion/i18n/account_statement_transactionid_completion.pot @@ -0,0 +1,43 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_statement_transactionid_completion +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:02+0000\n" +"PO-Revision-Date: 2014-01-21 12:02+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_statement_transactionid_completion +#: code:addons/account_statement_transactionid_completion/statement.py:65 +#, python-format +msgid "Line named \"%s\" (Ref:%s) was matched by more than one partner." +msgstr "" + +#. module: account_statement_transactionid_completion +#: model:ir.model,name:account_statement_transactionid_completion.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "" + +#. module: account_statement_transactionid_completion +#: help:account.bank.statement.line,transaction_id:0 +msgid "Transaction id from the financial institute" +msgstr "" + +#. module: account_statement_transactionid_completion +#: model:ir.model,name:account_statement_transactionid_completion.model_account_statement_completion_rule +msgid "account.statement.completion.rule" +msgstr "" + +#. module: account_statement_transactionid_completion +#: field:account.bank.statement.line,transaction_id:0 +msgid "Transaction ID" +msgstr "" + diff --git a/account_statement_transactionid_completion/test/completion_transactionid_test.yml b/account_statement_transactionid_completion/test/completion_transactionid_test.yml new file mode 100644 index 00000000..5b1cb4bd --- /dev/null +++ b/account_statement_transactionid_completion/test/completion_transactionid_test.yml @@ -0,0 +1,44 @@ +- + In order to test the banking framework, I first need to create a profile +- + !record {model: account.statement.profile, id: statement_profile_transactionid}: + name: Bank EUR Profile (transaction ID) + journal_id: account.bank_journal + commission_account_id: account.a_expense + company_id: base.main_company + balance_check: True + rule_ids: + - bank_statement_completion_rule_4 + - account_statement_base_completion.bank_statement_completion_rule_4 + - account_statement_base_completion.bank_statement_completion_rule_5 + - account_statement_base_completion.bank_statement_completion_rule_2 + - account_statement_base_completion.bank_statement_completion_rule_3 +- + Now I create a statement. I create statment lines separately because I need + to find each one by XML id +- + !record {model: account.bank.statement, id: statement_transactionid_test1}: + name: Statement with transaction ID + profile_id: statement_profile_transactionid + company_id: base.main_company +- + I create a statement line for a SO with transaction ID +- + !record {model: account.bank.statement.line, id: statement_line_transactionid}: + name: Test autocompletion based on SO with transaction ID + statement_id: statement_transactionid_test1 + transaction_id: XXX66Z + ref: 6 + date: '2014-01-06' + amount: 118.4 +- + I run the auto complete +- + !python {model: account.bank.statement}: | + result = self.button_auto_completion(cr, uid, [ref("statement_profile_transactionid")]) +- + Now I can check that all is nice and shiny, line 1. I expect the SO has been + recognised from the transaction ID. +- + !assert {model: account.bank.statement.line, id: statement_line_transactionid, string: Check completion by SO transaction ID}: + - partner_id.name == u'Agrolait' diff --git a/account_statement_transactionid_completion/test/sale.yml b/account_statement_transactionid_completion/test/sale.yml new file mode 100644 index 00000000..a8ba93a9 --- /dev/null +++ b/account_statement_transactionid_completion/test/sale.yml @@ -0,0 +1,11 @@ +- + I create a new Sale Order with transaction ID +- + !record {model: sale.order, id: so_with_transaction_id}: + partner_id: base.res_partner_2 + note: Invoice after delivery + payment_term: account.account_payment_term + transaction_id: XXX66Z + order_line: + - product_id: product.product_product_7 + product_uom_qty: 8 diff --git a/account_statement_transactionid_import/i18n/account_statement_transactionid_import.pot b/account_statement_transactionid_import/i18n/account_statement_transactionid_import.pot new file mode 100644 index 00000000..1f02b6f1 --- /dev/null +++ b/account_statement_transactionid_import/i18n/account_statement_transactionid_import.pot @@ -0,0 +1,21 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:02+0000\n" +"PO-Revision-Date: 2014-01-21 12:02+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_statement_transactionid_import +#: model:ir.model,name:account_statement_transactionid_import.model_account_statement_profile +msgid "Statement Profile" +msgstr "" + diff --git a/account_statement_transactionid_import/parser/transactionid_file_parser.py b/account_statement_transactionid_import/parser/transactionid_file_parser.py index ecc5d054..0a54b1e5 100644 --- a/account_statement_transactionid_import/parser/transactionid_file_parser.py +++ b/account_statement_transactionid_import/parser/transactionid_file_parser.py @@ -27,16 +27,21 @@ class TransactionIDFileParser(FileParser): bank statement. """ - def __init__(self, parse_name, ftype='csv'): - conversion_dict = {'transaction_id': unicode, - 'label': unicode, - 'date': datetime.datetime, - 'amount': float, - 'commission_amount': float} - # Order of cols does not matter but first row of the file has to be header - keys_to_validate = ['transaction_id', 'label', 'date', 'amount', 'commission_amount'] - super(TransactionIDFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, - ftype=ftype, conversion_dict=conversion_dict) + def __init__(self, parse_name, ftype='csv', extra_fields=None, header=None, **kwargs): + """ + Add transaction_id in header keys + :param char: parse_name: The name of the parser + :param char: ftype: extension of the file (could be csv or xls) + :param dict: extra_fields: extra fields to add to the conversion dict. In the format + {fieldname: fieldtype} + :param list: header : specify header fields if the csv file has no header + """ + extra_fields = {'transaction_id': unicode} + super(TransactionIDFileParser, self).__init__(parse_name, extra_fields=extra_fields, + ftype=ftype, header=header, **kwargs) + # ref is replaced by transaction_id thus we delete it from check + self.keys_to_validate = [k for k in self.keys_to_validate if k != 'ref'] + del self.conversion_dict['ref'] @classmethod def parser_for(cls, parser_name): @@ -73,14 +78,3 @@ class TransactionIDFileParser(FileParser): 'label': line.get('label', ''), 'transaction_id': line.get('transaction_id', '/'), 'commission_amount': line.get('commission_amount', 0.0)} - - def _post(self, *args, **kwargs): - """ - Compute the commission from value of each line - """ - res = super(TransactionIDFileParser, self)._post(*args, **kwargs) - val = 0.0 - for row in self.result_row_list: - val += row.get('commission_amount', 0.0) - self.commission_global_amount = val - return res diff --git a/base_transaction_id/i18n/base_transaction_id.pot b/base_transaction_id/i18n/base_transaction_id.pot new file mode 100644 index 00000000..6364a946 --- /dev/null +++ b/base_transaction_id/i18n/base_transaction_id.pot @@ -0,0 +1,58 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_transaction_id +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:03+0000\n" +"PO-Revision-Date: 2014-01-21 12:03+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_transaction_id +#: field:account.invoice,transaction_id:0 +#: field:sale.order,transaction_id:0 +msgid "Transaction id" +msgstr "" + +#. module: base_transaction_id +#: view:account.invoice:0 +msgid "Transactions datas" +msgstr "" + +#. module: base_transaction_id +#: help:sale.order,transaction_id:0 +msgid "Transaction id from the financial institute" +msgstr "" + +#. module: base_transaction_id +#: help:account.invoice,transaction_id:0 +msgid "Transction id from the financial institute" +msgstr "" + +#. module: base_transaction_id +#: model:ir.actions.act_window,name:base_transaction_id.prm_act +msgid "Packing" +msgstr "" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_stock_picking +msgid "Picking List" +msgstr "" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_sale_order +msgid "Sales Order" +msgstr "" + diff --git a/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot b/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot new file mode 100644 index 00000000..dec048dc --- /dev/null +++ b/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * invoicing_voucher_killer +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:00+0000\n" +"PO-Revision-Date: 2014-01-21 12:00+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: invoicing_voucher_killer +#: view:account.invoice:0 +msgid "Pay" +msgstr "" + +#. module: invoicing_voucher_killer +#: model:res.groups,name:invoicing_voucher_killer.invoice_voucher_user +msgid "Use voucher in Invoices" +msgstr "" + +#. module: invoicing_voucher_killer +#: view:account.invoice:0 +msgid "Register Payment" +msgstr "" + diff --git a/statement_voucher_killer/__openerp__.py b/statement_voucher_killer/__openerp__.py index 2460cd9a..1e5f2f1d 100644 --- a/statement_voucher_killer/__openerp__.py +++ b/statement_voucher_killer/__openerp__.py @@ -39,9 +39,9 @@ line will be take from imported line in this order: 'author': 'Camptocamp', 'website': 'http://www.camptocamp.com', 'depends': ['account_voucher', 'account_payment'], - 'init_xml': [], - 'update_xml': [], - 'demo_xml': [], + 'data': [ + 'statement_view.xml', + ], 'test': [], 'installable': True, 'active': False, diff --git a/statement_voucher_killer/i18n/statement_voucher_killer.pot b/statement_voucher_killer/i18n/statement_voucher_killer.pot new file mode 100644 index 00000000..5c314a5d --- /dev/null +++ b/statement_voucher_killer/i18n/statement_voucher_killer.pot @@ -0,0 +1,27 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * statement_voucher_killer +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 12:00+0000\n" +"PO-Revision-Date: 2014-01-21 12:00+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: statement_voucher_killer +#: model:ir.model,name:statement_voucher_killer.model_account_statement_from_invoice_lines +msgid "Entries by Statement from Invoices" +msgstr "" + +#. module: statement_voucher_killer +#: model:ir.model,name:statement_voucher_killer.model_account_payment_populate_statement +msgid "Account Payment Populate Statement" +msgstr "" + diff --git a/statement_voucher_killer/statement_view.xml b/statement_voucher_killer/statement_view.xml new file mode 100644 index 00000000..e0ceda0a --- /dev/null +++ b/statement_voucher_killer/statement_view.xml @@ -0,0 +1,20 @@ + + + + + + + + + account.bank.statement + + + form + + + + + + + +