diff --git a/account_banking_sepa_credit_transfer/__init__.py b/account_banking_sepa_credit_transfer/__init__.py index 207f87a21..c30bd487e 100644 --- a/account_banking_sepa_credit_transfer/__init__.py +++ b/account_banking_sepa_credit_transfer/__init__.py @@ -21,4 +21,4 @@ ############################################################################## from . import wizard -from . import account_banking_sepa +from . import models diff --git a/account_banking_sepa_credit_transfer/__openerp__.py b/account_banking_sepa_credit_transfer/__openerp__.py index fa2aa04e6..b7c3ff00e 100644 --- a/account_banking_sepa_credit_transfer/__openerp__.py +++ b/account_banking_sepa_credit_transfer/__openerp__.py @@ -22,43 +22,39 @@ { 'name': 'Account Banking SEPA Credit Transfer', 'summary': 'Create SEPA XML files for Credit Transfers', - 'version': '0.2', + 'version': '8.0.0.3.0', 'license': 'AGPL-3', - 'author': 'Akretion', - 'website': 'http://www.akretion.com', + 'author': "Akretion, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/bank-payment', 'category': 'Banking addons', 'depends': ['account_banking_pain_base'], 'external_dependencies': { 'python': ['unidecode', 'lxml'], }, 'data': [ - 'account_banking_sepa_view.xml', + 'views/account_banking_sepa_view.xml', 'wizard/export_sepa_view.xml', 'data/payment_type_sepa_sct.xml', 'security/ir.model.access.csv', ], - 'demo': ['sepa_credit_transfer_demo.xml'], + 'demo': [ + 'demo/sepa_credit_transfer_demo.xml' + ], 'description': ''' Module to export payment orders in SEPA XML file format. SEPA PAIN (PAyment INitiation) is the new european standard for -Customer-to-Bank payment instructions. - -This module implements SEPA Credit Transfer (SCT), more specifically PAIN -versions 001.001.02, 001.001.03, 001.001.04 and 001.001.05. -It is part of the ISO 20022 standard, available on http://www.iso20022.org. +Customer-to-Bank payment instructions. This module implements SEPA Credit +Transfer (SCT), more specifically PAIN versions 001.001.02, 001.001.03, +001.001.04 and 001.001.05. It is part of the ISO 20022 standard, available on +http://www.iso20022.org. The Implementation Guidelines for SEPA Credit Transfer published by the -European Payments Council (http://http://www.europeanpaymentscouncil.eu) -use PAIN version 001.001.03, so it's probably the version of PAIN that you -should try first. - -This module uses the framework provided by the banking addons, -cf https://www.github.com/OCA/banking-addons - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. +European Payments Council (http://http://www.europeanpaymentscouncil.eu) use +PAIN version 001.001.03, so it's probably the version of PAIN that you should +try first. ''', - 'active': False, 'installable': True, } diff --git a/account_banking_sepa_credit_transfer/account_banking_sepa.py b/account_banking_sepa_credit_transfer/account_banking_sepa.py deleted file mode 100644 index 99d5b022b..000000000 --- a/account_banking_sepa_credit_transfer/account_banking_sepa.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# SEPA Credit Transfer module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 orm, fields -from openerp.addons.decimal_precision import decimal_precision as dp -from unidecode import unidecode - - -class banking_export_sepa(orm.Model): - '''SEPA export''' - _name = 'banking.export.sepa' - _description = __doc__ - _rec_name = 'filename' - - def _generate_filename(self, cr, uid, ids, name, arg, context=None): - res = {} - for sepa_file in self.browse(cr, uid, ids, context=context): - ref = sepa_file.payment_order_ids[0].reference - if ref: - label = unidecode(ref.replace('/', '-')) - else: - label = 'error' - res[sepa_file.id] = 'sct_%s.xml' % label - return res - - _columns = { - 'payment_order_ids': fields.many2many( - 'payment.order', - 'account_payment_order_sepa_rel', - 'banking_export_sepa_id', 'account_order_id', - 'Payment Orders', - readonly=True), - 'nb_transactions': fields.integer( - 'Number of Transactions', readonly=True), - 'total_amount': fields.float( - 'Total Amount', digits_compute=dp.get_precision('Account'), - readonly=True), - 'batch_booking': fields.boolean( - 'Batch Booking', readonly=True, - help="If true, the bank statement will display only one debit " - "line for all the wire transfers of the SEPA XML file ; " - "if false, the bank statement will display one debit line " - "per wire transfer of the SEPA XML file."), - 'charge_bearer': fields.selection([ - ('SLEV', 'Following Service Level'), - ('SHAR', 'Shared'), - ('CRED', 'Borne by Creditor'), - ('DEBT', 'Borne by Debtor'), - ], 'Charge Bearer', readonly=True, - help="Following service level : transaction charges are to be " - "applied following the rules agreed in the service level and/or " - "scheme (SEPA Core messages must use this). Shared : " - "transaction charges on the creditor side are to be borne by " - "the creditor, transaction charges on the debtor side are to " - "be borne by the debtor. Borne by creditor : all transaction " - "charges are to be borne by the creditor. Borne by debtor : " - "all transaction charges are to be borne by the debtor."), - 'create_date': fields.datetime('Generation Date', readonly=True), - 'file': fields.binary('SEPA XML File', readonly=True), - 'filename': fields.function( - _generate_filename, type='char', size=256, string='Filename', - readonly=True), - 'state': fields.selection([ - ('draft', 'Draft'), - ('sent', 'Sent'), - ], 'State', readonly=True), - } - - _defaults = { - 'state': 'draft', - } diff --git a/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml b/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml index f07ece146..31d851edb 100644 --- a/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml +++ b/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml @@ -7,6 +7,7 @@ SEPA Credit Transfer v05 pain.001.001.05 + payment @@ -15,6 +16,7 @@ SEPA Credit Transfer v04 pain.001.001.04 + payment @@ -23,6 +25,7 @@ SEPA Credit Transfer v03 (recommended) pain.001.001.03 + payment @@ -31,6 +34,7 @@ SEPA Credit Transfer v02 pain.001.001.02 + payment diff --git a/account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml similarity index 92% rename from account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml rename to account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml index 77abf1b34..48e69a780 100644 --- a/account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml +++ b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml @@ -9,6 +9,7 @@ + diff --git a/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot b/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot index 38feaadd4..ae9645ceb 100644 --- a/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot +++ b/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_banking_sepa_credit_transfer # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 22:49+0000\n" -"PO-Revision-Date: 2013-12-23 22:49+0000\n" +"POT-Creation-Date: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,98 +15,18 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa.wizard,state:0 -msgid "Create" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,nb_transactions:0 -#: field:banking.export.sepa.wizard,nb_transactions:0 -msgid "Number of Transactions" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,filename:0 -#: field:banking.export.sepa.wizard,filename:0 -msgid "Filename" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,state:0 -#: field:banking.export.sepa.wizard,state:0 -msgid "State" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,state:0 -msgid "Draft" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: help:banking.export.sepa.wizard,charge_bearer:0 -msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the debtor side are to be borne by the debtor, transaction charges on the creditor side are to be borne by the creditor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor." -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,charge_bearer:0 -#: selection:banking.export.sepa.wizard,charge_bearer:0 -msgid "Shared" -msgstr "" - #. module: account_banking_sepa_credit_transfer #: field:banking.export.sepa,batch_booking:0 #: field:banking.export.sepa.wizard,batch_booking:0 msgid "Batch Booking" msgstr "" -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,state:0 -msgid "Sent" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard -msgid "Export SEPA Credit Transfer File" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa:0 -msgid "SEPA Credit Transfer" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa.wizard,state:0 -msgid "Finish" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,state:0 -msgid "Reconciled" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,charge_bearer:0 -#: selection:banking.export.sepa.wizard,charge_bearer:0 -msgid "Following Service Level" -msgstr "" - #. module: account_banking_sepa_credit_transfer #: selection:banking.export.sepa,charge_bearer:0 #: selection:banking.export.sepa.wizard,charge_bearer:0 msgid "Borne by Creditor" msgstr "" -#. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "Validate" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "Generate" -msgstr "" - #. module: account_banking_sepa_credit_transfer #: selection:banking.export.sepa,charge_bearer:0 #: selection:banking.export.sepa.wizard,charge_bearer:0 @@ -114,16 +34,8 @@ msgid "Borne by Debtor" msgstr "" #. module: account_banking_sepa_credit_transfer -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:128 -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:245 -#, python-format -msgid "Error:" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,total_amount:0 -#: field:banking.export.sepa.wizard,total_amount:0 -msgid "Total Amount" +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Cancel" msgstr "" #. module: account_banking_sepa_credit_transfer @@ -133,25 +45,57 @@ msgid "Charge Bearer" msgstr "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "SEPA File Generation" +#: selection:banking.export.sepa.wizard,state:0 +msgid "Create" msgstr "" #. module: account_banking_sepa_credit_transfer -#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa -msgid "SEPA export" +#: field:banking.export.sepa,create_uid:0 +#: field:banking.export.sepa.wizard,create_uid:0 +msgid "Created by" msgstr "" #. module: account_banking_sepa_credit_transfer -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:246 +#: field:banking.export.sepa.wizard,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,state:0 +msgid "Draft" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:124 +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:232 #, python-format -msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')." +msgid "Error:" msgstr "" #. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,file:0 -#: field:banking.export.sepa.wizard,file_id:0 -msgid "SEPA XML File" +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard +msgid "Export SEPA Credit Transfer File" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,file:0 +msgid "File" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,filename:0 +msgid "Filename" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +msgid "Finish" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Following Service Level" msgstr "" #. module: account_banking_sepa_credit_transfer @@ -160,21 +104,78 @@ msgid "Following service level : transaction charges are to be applied following msgstr "" #. module: account_banking_sepa_credit_transfer -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:129 -#, python-format -msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'." +#: help:banking.export.sepa.wizard,charge_bearer:0 +msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the debtor side are to be borne by the debtor, transaction charges on the creditor side are to be borne by the creditor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor." msgstr "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa:0 +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form +msgid "General Information" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Generate" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,create_date:0 +msgid "Generation Date" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,id:0 +#: field:banking.export.sepa.wizard,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: help:banking.export.sepa,batch_booking:0 +#: help:banking.export.sepa.wizard,batch_booking:0 +msgid "If true, the bank statement will display only one debit line for all the wire transfers of the SEPA XML file ; if false, the bank statement will display one debit line per wire transfer of the SEPA XML file." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,write_uid:0 +#: field:banking.export.sepa.wizard,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,write_date:0 +#: field:banking.export.sepa.wizard,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:233 +#, python-format +msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,nb_transactions:0 +#: field:banking.export.sepa.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form #: field:banking.export.sepa,payment_order_ids:0 #: field:banking.export.sepa.wizard,payment_order_ids:0 msgid "Payment Orders" msgstr "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa:0 -msgid "General Information" +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125 +#, python-format +msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_tree +msgid "SEPA Credit Transfer" msgstr "" #. module: account_banking_sepa_credit_transfer @@ -185,23 +186,46 @@ msgid "SEPA Credit Transfer Files" msgstr "" #. module: account_banking_sepa_credit_transfer -#: help:banking.export.sepa,batch_booking:0 -#: help:banking.export.sepa.wizard,batch_booking:0 -msgid "If true, the bank statement will display only one debit line for all the wire transfers of the SEPA XML file ; if false, the bank statement will display one debit line per wire transfer of the SEPA XML file." +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "SEPA File Generation" msgstr "" #. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa.wizard,file:0 -msgid "File" +#: field:banking.export.sepa,file:0 +#: field:banking.export.sepa.wizard,file_id:0 +msgid "SEPA XML File" msgstr "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "Cancel" +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa +msgid "SEPA export" msgstr "" #. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,create_date:0 -msgid "Generation Date" +#: selection:banking.export.sepa,state:0 +msgid "Sent" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,state:0 +#: field:banking.export.sepa.wizard,state:0 +msgid "State" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,total_amount:0 +#: field:banking.export.sepa.wizard,total_amount:0 +msgid "Total Amount" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Validate" msgstr "" diff --git a/account_banking_sepa_credit_transfer/i18n/es.po b/account_banking_sepa_credit_transfer/i18n/es.po new file mode 100644 index 000000000..5d7b1057b --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/es.po @@ -0,0 +1,231 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+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_banking_sepa_credit_transfer +#: field:banking.export.sepa,batch_booking:0 +#: field:banking.export.sepa.wizard,batch_booking:0 +msgid "Batch Booking" +msgstr "Registro en lote" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "A cargo del acreedor" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "A cargo del deudor" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,charge_bearer:0 +#: field:banking.export.sepa.wizard,charge_bearer:0 +msgid "Charge Bearer" +msgstr "A cargo del portador" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +msgid "Create" +msgstr "Crear" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,create_uid:0 +#: field:banking.export.sepa.wizard,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,state:0 +msgid "Draft" +msgstr "Borrador" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:124 +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:232 +#, python-format +msgid "Error:" +msgstr "Error:" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard +msgid "Export SEPA Credit Transfer File" +msgstr "Exportar archivo de transferencia SEPA" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,file:0 +msgid "File" +msgstr "Archivo" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,filename:0 +msgid "Filename" +msgstr "Nombre de archivo" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +msgid "Finish" +msgstr "Finalizar" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Following Service Level" +msgstr "Según el acuerdo de servicio" + +#. module: account_banking_sepa_credit_transfer +#: help:banking.export.sepa,charge_bearer:0 +msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the creditor side are to be borne by the creditor, transaction charges on the debtor side are to be borne by the debtor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor." +msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor." + +#. module: account_banking_sepa_credit_transfer +#: help:banking.export.sepa.wizard,charge_bearer:0 +msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the debtor side are to be borne by the debtor, transaction charges on the creditor side are to be borne by the creditor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor." +msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor." + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form +msgid "General Information" +msgstr "Información general" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Generate" +msgstr "Generar" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,create_date:0 +msgid "Generation Date" +msgstr "Fecha de generación" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,id:0 +#: field:banking.export.sepa.wizard,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_sepa_credit_transfer +#: help:banking.export.sepa,batch_booking:0 +#: help:banking.export.sepa.wizard,batch_booking:0 +msgid "If true, the bank statement will display only one debit line for all the wire transfers of the SEPA XML file ; if false, the bank statement will display one debit line per wire transfer of the SEPA XML file." +msgstr "Si está marcado, el extracto bancario mostrará sólo una línea del haber para todos los adeudos directos del archivo SEPA; si no está marcado, entonces el extracto bancario mostrará una línea por cada adeudo directo del archivo SEPA." + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,write_uid:0 +#: field:banking.export.sepa.wizard,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,write_date:0 +#: field:banking.export.sepa.wizard,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:233 +#, python-format +msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')." +msgstr "Falta la cuenta bancaria en la factura '%s' (línea de pago con referencia '%s')." + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,nb_transactions:0 +#: field:banking.export.sepa.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "Nº de transacciones" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form +#: field:banking.export.sepa,payment_order_ids:0 +#: field:banking.export.sepa.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "Órdenes de pago" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125 +#, python-format +msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'." +msgstr "El código de tipo de pago '%s' no está soportado. Los únicos código de tipo de pago soportados por las transferencias SEPA son 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' y 'pain.001.001.05'." + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_tree +msgid "SEPA Credit Transfer" +msgstr "Transferencia SEPA" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order +#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa +#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa +msgid "SEPA Credit Transfer Files" +msgstr "Archivos de transferencias SEPA" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "SEPA File Generation" +msgstr "Generación de archivo SEPA" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,file:0 +#: field:banking.export.sepa.wizard,file_id:0 +msgid "SEPA XML File" +msgstr "Archivo SEPA XML" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa +msgid "SEPA export" +msgstr "Exportación de SEPA" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,state:0 +msgid "Sent" +msgstr "Enviado" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Shared" +msgstr "Compartidos" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,state:0 +#: field:banking.export.sepa.wizard,state:0 +msgid "State" +msgstr "Estado" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,total_amount:0 +#: field:banking.export.sepa.wizard,total_amount:0 +msgid "Total Amount" +msgstr "Importe total" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Validate" +msgstr "Validar" + diff --git a/account_banking_sepa_credit_transfer/models/__init__.py b/account_banking_sepa_credit_transfer/models/__init__.py new file mode 100644 index 000000000..90e481210 --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Credit Transfer module for OpenERP +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 account_banking_sepa diff --git a/account_banking_sepa_credit_transfer/models/account_banking_sepa.py b/account_banking_sepa_credit_transfer/models/account_banking_sepa.py new file mode 100644 index 000000000..77213c29f --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/account_banking_sepa.py @@ -0,0 +1,80 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Credit Transfer module for OpenERP +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 import models, fields, api +from openerp.addons.decimal_precision import decimal_precision as dp + +try: + from unidecode import unidecode +except ImportError: + unidecode = None + + +class BankingExportSepa(models.Model): + """SEPA export""" + _name = 'banking.export.sepa' + _description = __doc__ + _rec_name = 'filename' + + @api.one + def _generate_filename(self): + ref = self.payment_order_ids[0].reference + if ref: + label = unidecode(ref.replace('/', '-')) + else: + label = 'error' + self.filename = 'sct_%s.xml' % label + + payment_order_ids = fields.Many2many( + comodel_name='payment.order', column1='banking_export_sepa_id', + column2='account_order_id', relation='account_payment_order_sepa_rel', + string='Payment Orders', readonly=True) + nb_transactions = fields.Integer(string='Number of Transactions', + readonly=True) + total_amount = fields.Float(string='Total Amount', + digits_compute=dp.get_precision('Account'), + readonly=True) + batch_booking = fields.Boolean( + 'Batch Booking', readonly=True, + help="If true, the bank statement will display only one debit line " + "for all the wire transfers of the SEPA XML file ; if false, " + "the bank statement will display one debit line per wire " + "transfer of the SEPA XML file.") + charge_bearer = fields.Selection( + [('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], string='Charge Bearer', readonly=True, + help="Following service level : transaction charges are to be applied " + "following the rules agreed in the service level and/or scheme " + "(SEPA Core messages must use this). Shared : transaction " + "charges on the creditor side are to be borne by the creditor, " + "transaction charges on the debtor side are to be borne by the " + "debtor. Borne by creditor : all transaction charges are to be " + "borne by the creditor. Borne by debtor : all transaction " + "charges are to be borne by the debtor.") + create_date = fields.Datetime('Generation Date', readonly=True) + file = fields.Binary('SEPA XML File', readonly=True) + filename = fields.Char(string='Filename', size=256, readonly=True, + compute=_generate_filename) + state = fields.Selection([('draft', 'Draft'), ('sent', 'Sent')], + string='State', readonly=True, default='draft') diff --git a/account_banking_sepa_credit_transfer/static/description/icon.png b/account_banking_sepa_credit_transfer/static/description/icon.png new file mode 100644 index 000000000..e1485aabd Binary files /dev/null and b/account_banking_sepa_credit_transfer/static/description/icon.png differ diff --git a/account_banking_sepa_credit_transfer/static/description/icon.svg b/account_banking_sepa_credit_transfer/static/description/icon.svg new file mode 100644 index 000000000..266ef8442 --- /dev/null +++ b/account_banking_sepa_credit_transfer/static/description/icon.svg @@ -0,0 +1,92 @@ + + + +image/svg+xmlCREDITTRANSFER + \ No newline at end of file diff --git a/account_banking_sepa_credit_transfer/static/src/img/icon.png b/account_banking_sepa_credit_transfer/static/src/img/icon.png deleted file mode 100644 index 12ecf91ce..000000000 Binary files a/account_banking_sepa_credit_transfer/static/src/img/icon.png and /dev/null differ diff --git a/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml b/account_banking_sepa_credit_transfer/views/account_banking_sepa_view.xml similarity index 100% rename from account_banking_sepa_credit_transfer/account_banking_sepa_view.xml rename to account_banking_sepa_credit_transfer/views/account_banking_sepa_view.xml diff --git a/account_banking_sepa_credit_transfer/wizard/export_sepa.py b/account_banking_sepa_credit_transfer/wizard/export_sepa.py index eb2461ad8..94b2004a3 100644 --- a/account_banking_sepa_credit_transfer/wizard/export_sepa.py +++ b/account_banking_sepa_credit_transfer/wizard/export_sepa.py @@ -23,40 +23,39 @@ from openerp.osv import orm, fields from openerp.tools.translate import _ -from openerp import netsvc +from openerp import workflow from lxml import etree -class banking_export_sepa_wizard(orm.TransientModel): +class BankingExportSepaWizard(orm.TransientModel): _name = 'banking.export.sepa.wizard' _inherit = ['banking.export.pain'] _description = 'Export SEPA Credit Transfer File' _columns = { - 'state': fields.selection([ - ('create', 'Create'), - ('finish', 'Finish'), - ], 'State', readonly=True), + 'state': fields.selection([('create', 'Create'), + ('finish', 'Finish')], 'State', + readonly=True), 'batch_booking': fields.boolean( 'Batch Booking', help="If true, the bank statement will display only one debit " "line for all the wire transfers of the SEPA XML file ; if " "false, the bank statement will display one debit line per wire " "transfer of the SEPA XML file."), - 'charge_bearer': fields.selection([ - ('SLEV', 'Following Service Level'), - ('SHAR', 'Shared'), - ('CRED', 'Borne by Creditor'), - ('DEBT', 'Borne by Debtor'), - ], 'Charge Bearer', required=True, + 'charge_bearer': fields.selection( + [('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], 'Charge Bearer', required=True, help="Following service level : transaction charges are to be " - "applied following the rules agreed in the service level and/or " - "scheme (SEPA Core messages must use this). Shared : transaction " - "charges on the debtor side are to be borne by the debtor, " - "transaction charges on the creditor side are to be borne by " - "the creditor. Borne by creditor : all transaction charges are " - "to be borne by the creditor. Borne by debtor : all transaction " - "charges are to be borne by the debtor."), + "applied following the rules agreed in the service level " + "and/or scheme (SEPA Core messages must use this). Shared : " + "transaction charges on the debtor side are to be borne by " + "the debtor, transaction charges on the creditor side are to " + "be borne by the creditor. Borne by creditor : all " + "transaction charges are to be borne by the creditor. Borne " + "by debtor : all transaction charges are to be borne by the " + "debtor."), 'nb_transactions': fields.related( 'file_id', 'nb_transactions', type='integer', string='Number of Transactions', readonly=True), @@ -73,25 +72,23 @@ class banking_export_sepa_wizard(orm.TransientModel): 'payment_order_ids': fields.many2many( 'payment.order', 'wiz_sepa_payorders_rel', 'wizard_id', 'payment_order_id', 'Payment Orders', readonly=True), - } + } _defaults = { 'charge_bearer': 'SLEV', 'state': 'create', - } + } def create(self, cr, uid, vals, context=None): payment_order_ids = context.get('active_ids', []) vals.update({ 'payment_order_ids': [[6, 0, payment_order_ids]], }) - return super(banking_export_sepa_wizard, self).create( + return super(BankingExportSepaWizard, self).create( cr, uid, vals, context=context) def create_sepa(self, cr, uid, ids, context=None): - ''' - Creates the SEPA Credit Transfer file. That's the important code ! - ''' + """Creates the SEPA Credit Transfer file. That's the important code!""" if context is None: context = {} sepa_export = self.browse(cr, uid, ids[0], context=context) @@ -122,16 +119,14 @@ class banking_export_sepa_wizard(orm.TransientModel): bic_xml_tag = 'BICFI' name_maxsize = 140 root_xml_tag = 'CstmrCdtTrfInitn' - else: raise orm.except_orm( _('Error:'), _("Payment Type Code '%s' is not supported. The only " - "Payment Type Codes supported for SEPA Credit Transfers " - "are 'pain.001.001.02', 'pain.001.001.03', " - "'pain.001.001.04' and 'pain.001.001.05'.") - % pain_flavor) - + "Payment Type Codes supported for SEPA Credit Transfers " + "are 'pain.001.001.02', 'pain.001.001.03', " + "'pain.001.001.04' and 'pain.001.001.05'.") % + pain_flavor) gen_args = { 'bic_xml_tag': bic_xml_tag, 'name_maxsize': name_maxsize, @@ -144,22 +139,18 @@ class banking_export_sepa_wizard(orm.TransientModel): 'account_banking_sepa_credit_transfer/data/%s.xsd' % pain_flavor, } - pain_ns = { 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', None: 'urn:iso:std:iso:20022:tech:xsd:%s' % pain_flavor, - } - + } xml_root = etree.Element('Document', nsmap=pain_ns) pain_root = etree.SubElement(xml_root, root_xml_tag) pain_03_to_05 = \ ['pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05'] - # A. Group header group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 = \ self.generate_group_header_block( cr, uid, pain_root, gen_args, context=context) - transactions_count_1_6 = 0 total_amount = 0.0 amount_control_sum_1_7 = 0.0 @@ -187,7 +178,6 @@ class banking_export_sepa_wizard(orm.TransientModel): self.pool['payment.line'].write( cr, uid, line.id, {'date': requested_date}, context=context) - for (requested_date, priority), lines in lines_per_group.items(): # B. Payment info payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 = \ @@ -200,7 +190,6 @@ class banking_export_sepa_wizard(orm.TransientModel): 'priority': priority, 'requested_date': requested_date, }, gen_args, context=context) - self.generate_party_block( cr, uid, payment_info_2_0, 'Dbtr', 'B', 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.' @@ -209,10 +198,8 @@ class banking_export_sepa_wizard(orm.TransientModel): 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic', {'sepa_export': sepa_export}, gen_args, context=context) - charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr') charge_bearer_2_24.text = sepa_export.charge_bearer - transactions_count_2_4 = 0 amount_control_sum_2_5 = 0.0 for line in lines: @@ -240,7 +227,6 @@ class banking_export_sepa_wizard(orm.TransientModel): instructed_amount_2_43.text = '%.2f' % line.amount_currency amount_control_sum_1_7 += line.amount_currency amount_control_sum_2_5 += line.amount_currency - if not line.bank_id: raise orm.except_orm( _('Error:'), @@ -252,48 +238,40 @@ class banking_export_sepa_wizard(orm.TransientModel): 'C', 'line.partner_id.name', 'line.bank_id.acc_number', 'line.bank_id.bank.bic', {'line': line}, gen_args, context=context) - self.generate_remittance_info_block( cr, uid, credit_transfer_transaction_info_2_27, line, gen_args, context=context) - if pain_flavor in pain_03_to_05: nb_of_transactions_2_4.text = str(transactions_count_2_4) control_sum_2_5.text = '%.2f' % amount_control_sum_2_5 - if pain_flavor in pain_03_to_05: nb_of_transactions_1_6.text = str(transactions_count_1_6) control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 else: nb_of_transactions_1_6.text = str(transactions_count_1_6) control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 - return self.finalize_sepa_file_creation( cr, uid, ids, xml_root, total_amount, transactions_count_1_6, gen_args, context=context) def cancel_sepa(self, cr, uid, ids, context=None): - ''' - Cancel the SEPA file: just drop the file - ''' + """Cancel the SEPA file: just drop the file""" sepa_export = self.browse(cr, uid, ids[0], context=context) - self.pool.get('banking.export.sepa').unlink( + self.pool['banking.export.sepa'].unlink( cr, uid, sepa_export.file_id.id, context=context) return {'type': 'ir.actions.act_window_close'} def save_sepa(self, cr, uid, ids, context=None): - ''' - Save the SEPA file: send the done signal to all payment + """Save the SEPA file: send the done signal to all payment orders in the file. With the default workflow, they will transition to 'done', while with the advanced workflow in account_banking_payment they will transition to 'sent' waiting reconciliation. - ''' + """ sepa_export = self.browse(cr, uid, ids[0], context=context) - self.pool.get('banking.export.sepa').write( + self.pool['banking.export.sepa'].write( cr, uid, sepa_export.file_id.id, {'state': 'sent'}, context=context) - wf_service = netsvc.LocalService('workflow') for order in sepa_export.payment_order_ids: - wf_service.trg_validate(uid, 'payment.order', order.id, 'done', cr) + workflow.trg_validate(uid, 'payment.order', order.id, 'done', cr) return {'type': 'ir.actions.act_window_close'}