diff --git a/account_banking_sepa_credit_transfer/__openerp__.py b/account_banking_sepa_credit_transfer/__openerp__.py index 751058ea2..5f310feec 100644 --- a/account_banking_sepa_credit_transfer/__openerp__.py +++ b/account_banking_sepa_credit_transfer/__openerp__.py @@ -21,12 +21,15 @@ { 'name': 'Account Banking SEPA Credit Transfer', 'summary': 'Create SEPA XML files for Credit Transfers', - 'version': '0.1', + 'version': '0.2', 'license': 'AGPL-3', 'author': 'Akretion', 'website': 'http://www.akretion.com', 'category': 'Banking addons', - 'depends': ['account_banking_payment_export'], + 'depends': ['account_banking_payment'], + 'external_dependencies': { + 'python': ['unidecode', 'lxml'], + }, 'data': [ 'account_banking_sepa_view.xml', 'wizard/export_sepa_view.xml', @@ -36,7 +39,7 @@ '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 and 001.001.04. It is part of the ISO 20022 standard, available on http://www.iso20022.org. +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. 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. diff --git a/account_banking_sepa_credit_transfer/account_banking_sepa.py b/account_banking_sepa_credit_transfer/account_banking_sepa.py index 432b59267..cd05413cf 100644 --- a/account_banking_sepa_credit_transfer/account_banking_sepa.py +++ b/account_banking_sepa_credit_transfer/account_banking_sepa.py @@ -21,18 +21,24 @@ 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 = 'msg_identification' + _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): - res[sepa_file.id] = 'sepa_' + (sepa_file.msg_identification or '') + '.xml' + ref = sepa_file.payment_order_ids[0].reference + if ref: + label = ref.replace('/', '-') + else: + label = 'error' + res[sepa_file.id] = 'sct_%s.xml' % label return res _columns = { @@ -40,32 +46,34 @@ class banking_export_sepa(orm.Model): 'payment.order', 'account_payment_order_sepa_rel', 'banking_export_sepa_id', 'account_order_id', - 'Payment orders', + 'Payment Orders', readonly=True), - 'prefered_exec_date': fields.date('Prefered execution date', readonly=True), - 'nb_transactions': fields.integer('Number of transactions', readonly=True), - 'total_amount': fields.float('Total amount', + 'prefered_exec_date': fields.date( + 'Prefered Execution Date', 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), - 'msg_identification': fields.char('Message identification', size=35, - readonly=True), - 'batch_booking': fields.boolean('Batch booking', 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([ ('SHAR', 'Shared'), ('CRED', 'Borne by creditor'), ('DEBT', 'Borne by debtor'), ('SLEV', 'Following service level'), - ], 'Charge bearer', readonly=True, + ], 'Charge Bearer', readonly=True, help='Shared : transaction charges on the sender side are to be borne by the debtor, transaction charges on the receiver side are to be borne by the creditor (most transfers use this). 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. Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme.'), - 'generation_date': fields.datetime('Generation date', + 'generation_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), - 'file': fields.binary('SEPA XML file', readonly=True), - 'filename': fields.function(_generate_filename, type='char', size=256, - method=True, string='Filename', readonly=True), 'state': fields.selection([ - ('draft', 'Draft'), - ('sent', 'Sent'), - ('done', 'Reconciled'), + ('draft', 'Draft'), + ('sent', 'Sent'), + ('done', 'Reconciled'), ], 'State', readonly=True), } diff --git a/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml b/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml index 1fdab318f..c4bd1aa8a 100644 --- a/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml +++ b/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml @@ -14,7 +14,6 @@