[IMP] account_banking_sepa_credit_transfer:

* Better prototype for the _prepare_field function. Update help message, POT file and FR translation.
* Revert the dependancy to account_banking_payment_export (the field payment_order_type on payment.mode.type has a default value of "payment" anyway).
* Akretion-Noviat code sprint dated 2013-11-21: - add module account_banking_pain_base - add support for initiating party identification, priority and structured remittance info in XML file - the requested execution date now uses the fields date_prefered and date_scheduled (the field of the wizard has been removed) - the 'convert to ascii' feature is now an option of the payment mode (enabled by default) - set 'communication' field of payment.line to 140 chars and hide field 'communicatio n2'
* FIX label : Customer (which is wrong, it is most of the time a Supplier !)-> Creditor More PEP8 stuff.
This commit is contained in:
Alexis de Lattre
2013-11-12 22:38:21 +01:00
committed by Dũng (Trần Đình)
parent fb41727e70
commit 07c05a7ab9
8 changed files with 369 additions and 321 deletions

View File

@@ -26,7 +26,7 @@
'author': 'Akretion',
'website': 'http://www.akretion.com',
'category': 'Banking addons',
'depends': ['account_banking_payment'],
'depends': ['account_banking_pain_base'],
'external_dependencies': {
'python': ['unidecode', 'lxml'],
},

View File

@@ -48,8 +48,6 @@ class banking_export_sepa(orm.Model):
'banking_export_sepa_id', 'account_order_id',
'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',
@@ -58,12 +56,12 @@ class banking_export_sepa(orm.Model):
'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'),
('SLEV', 'Following Service Level'),
], '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.'),
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(

View File

@@ -16,7 +16,6 @@
<page string="General Information">
<field name="total_amount" />
<field name="nb_transactions" />
<field name="prefered_exec_date" />
<field name="batch_booking" />
<field name="charge_bearer"/>
<field name="create_date" />
@@ -47,7 +46,6 @@
<field name="arch" type="xml">
<tree string="SEPA Credit Transfer">
<field name="filename"/>
<field name="prefered_exec_date"/>
<field name="create_date"/>
<field name="nb_transactions"/>
</tree>

View File

@@ -10,7 +10,6 @@
<field name="suitable_bank_types"
eval="[(6,0,[ref('base_iban.bank_iban')])]" />
<field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
<field name="payment_order_type">payment</field>
</record>
<record id="export_sepa_sct_001_001_04" model="payment.mode.type">
@@ -19,7 +18,6 @@
<field name="suitable_bank_types"
eval="[(6,0,[ref('base_iban.bank_iban')])]" />
<field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
<field name="payment_order_type">payment</field>
</record>
<record id="export_sepa_sct_001_001_03" model="payment.mode.type">
@@ -28,7 +26,6 @@
<field name="suitable_bank_types"
eval="[(6,0,[ref('base_iban.bank_iban')])]" />
<field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
<field name="payment_order_type">payment</field>
</record>
<record id="export_sepa_sct_001_001_02" model="payment.mode.type">
@@ -37,7 +34,6 @@
<field name="suitable_bank_types"
eval="[(6,0,[ref('base_iban.bank_iban')])]" />
<field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
<field name="payment_order_type">payment</field>
</record>

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-11-06 16:22+0000\n"
"PO-Revision-Date: 2013-11-06 16:22+0000\n"
"POT-Creation-Date: 2013-11-13 09:13+0000\n"
"PO-Revision-Date: 2013-11-13 09:13+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,6 +15,12 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,prefered_exec_date:0
#: field:banking.export.sepa.wizard,prefered_exec_date:0
msgid "Prefered Execution Date"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa.wizard,state:0
msgid "Create"
@@ -44,13 +50,12 @@ msgid "Draft"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,prefered_exec_date:0
#: field:banking.export.sepa.wizard,prefered_exec_date:0
msgid "Prefered Execution Date"
#: 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
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:119
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:117
#, python-format
msgid "Cannot compute the '%s' of the Payment Line with Invoice Reference '%s'."
msgstr ""
@@ -100,13 +105,13 @@ msgid "Borne by Creditor"
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:122
#, python-format
msgid "Cannot compute the '%s'."
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:126
#, python-format
msgid "The type of the field '%s' is %s. It should be a string or unicode."
msgstr ""
@@ -127,13 +132,7 @@ msgid "Generate"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa,charge_bearer:0
#: help:banking.export.sepa.wizard,charge_bearer:0
msgid "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."
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:171
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:169
#, python-format
msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s"
msgstr ""
@@ -146,12 +145,12 @@ msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:118
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:123
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:132
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:170
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:208
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:352
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:116
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:121
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:130
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:168
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:206
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:350
#, python-format
msgid "Error:"
msgstr ""
@@ -174,7 +173,7 @@ msgid "SEPA File Generation"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:127
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125
#, python-format
msgid "Field type error:"
msgstr ""
@@ -185,7 +184,7 @@ msgid "SEPA export"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:353
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:351
#, python-format
msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')."
msgstr ""
@@ -197,13 +196,18 @@ msgid "SEPA XML File"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:133
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:131
#, python-format
msgid "The '%s' is empty or 0. It should have a non-null value."
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:209
#: 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 ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:207
#, 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 ""
@@ -255,7 +259,7 @@ msgid "Cancel"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,generation_date:0
#: field:banking.export.sepa,create_date:0
msgid "Generation Date"
msgstr ""

View File

@@ -4,28 +4,22 @@
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.1\n"
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-25 15:59+0000\n"
"PO-Revision-Date: 2013-11-11 17:51+0000\n"
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
"POT-Creation-Date: 2013-11-13 09:14+0000\n"
"PO-Revision-Date: 2013-11-13 09:14+0000\n"
"Last-Translator: <>\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: 2013-11-12 06:38+0000\n"
"X-Generator: Launchpad (build 16820)\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. 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 "Fichier SEPA XML"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa:0
msgid "Payment order"
msgstr "Ordre de paiement"
#: field:banking.export.sepa,prefered_exec_date:0
#: field:banking.export.sepa.wizard,prefered_exec_date:0
msgid "Prefered Execution Date"
msgstr "Date d'exécution demandée"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa.wizard,state:0
@@ -33,13 +27,10 @@ msgid "Create"
msgstr "Créer"
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa.wizard,msg_identification:0
msgid ""
"This is the message identification of the entire SEPA XML file. 35 "
"characters max."
msgstr ""
"Ceci est le libellé d'identification du fichier SEPA XML. 35 caractères "
"maximum."
#: field:banking.export.sepa,nb_transactions:0
#: field:banking.export.sepa.wizard,nb_transactions:0
msgid "Number of Transactions"
msgstr "Nombre de transactions"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,filename:0
@@ -59,10 +50,15 @@ msgid "Draft"
msgstr "Brouillon"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,prefered_exec_date:0
#: field:banking.export.sepa.wizard,prefered_exec_date:0
msgid "Prefered execution date"
msgstr "Date d'exécution demandée"
#: 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 "Suivant le niveau de service : la répartition des frais bancaires suit les règles pré-établies dans le schema ou dans le contrat avec la banque (les messages SEPA Core doivent utiliser ce paramètre). Partagés : les frais bancaires côté débiteur sont à la charge du débiteur, les frais bancaires côté créancier sont à la charge du créancier. Supportés par le créancier : tous les frais bancaires sont à la charge du créancier. Supportés par le débiteur : tous les frais bancaires sont à la charge du débiteur."
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:117
#, python-format
msgid "Cannot compute the '%s' of the Payment Line with Invoice Reference '%s'."
msgstr "Impossible de générer le '%s' de la ligne de paiement ayant la référence de facture '%s'."
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,charge_bearer:0
@@ -71,9 +67,10 @@ msgid "Shared"
msgstr "Partagé"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,generation_date:0
msgid "Generation date"
msgstr "Date de génération"
#: field:banking.export.sepa,batch_booking:0
#: field:banking.export.sepa.wizard,batch_booking:0
msgid "Batch Booking"
msgstr "Débit groupé"
#. module: account_banking_sepa_credit_transfer
#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard
@@ -95,6 +92,30 @@ msgstr "Finir"
msgid "Reconciled"
msgstr "Réconcilié"
#. 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 "Suivant le niveau de service"
#. 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 "Supportés par le destinataire"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:122
#, python-format
msgid "Cannot compute the '%s'."
msgstr "Impossible de générer le '%s'."
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:126
#, python-format
msgid "The type of the field '%s' is %s. It should be a string or unicode."
msgstr "Le champ '%s' est de type %s. Le type devrait être string ou unicode."
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,state:0
msgid "Sent"
@@ -111,88 +132,51 @@ msgid "Generate"
msgstr "Générer"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,msg_identification:0
#: field:banking.export.sepa.wizard,msg_identification:0
msgid "Message identification"
msgstr "Libellé d'identification"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:287
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:169
#, python-format
msgid ""
"The generated XML file is not valid against the official XML Schema "
"Definition. The generated XML file and the full error have been written in "
"the server logs. Here is the error, which may give you an idea on the cause "
"of the problem : %s"
msgstr ""
"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma "
"XML officiel. Le fichier XML généré et le message d'erreur complet ont été "
"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être "
"une idée sur la cause du problème : %s"
#. 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 "Montant total"
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa,charge_bearer:0
#: help:banking.export.sepa.wizard,charge_bearer:0
msgid ""
"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."
msgstr ""
"Partagés : les frais bancaires côté émetteur sont à la charge de l'émetteur "
"et les frais bancaires côté destinataire sont à la charge du destinataire "
"(la plupart des virements utilisent cette répartition). Supportés par le "
"destinataire : tous les frais bancaires sont à la charge du destinataire. "
"Supportés par l'émetteur : tous les frais bancaires sont à la charge de "
"l'émetteur. Suivant le niveau de service : la répartition des frais "
"bancaires suit les règles pré-établies dans le contrat avec la banque."
msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s"
msgstr "Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma XML officiel. Le fichier XML généré et le message d'erreur complet ont été écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être une idée sur la cause du problème : %s"
#. 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 "Supportés par le destinataire"
msgid "Borne by Debtor"
msgstr "Supportés par l'émetteur"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,payment_order_ids:0
#: field:banking.export.sepa.wizard,payment_order_ids:0
msgid "Payment orders"
msgstr "Ordres de paiement"
#. module: account_banking_sepa_credit_transfer
#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
msgid "Generated SEPA Credit Transfer files"
msgstr ""
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:89
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:116
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:121
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:130
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:168
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:206
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:350
#, python-format
msgid "This IBAN is not valid : %s"
msgstr "Cet IBAN n'est pas valide : %s"
msgid "Error:"
msgstr "Erreur :"
#. 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 "Montant total"
#. 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 "Répartition des frais"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa.wizard:0
msgid "SEPA XML file generation"
msgstr "Génération du fichier SEPA XML"
msgid "SEPA File Generation"
msgstr "Génération du fichier SEPA"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa.wizard:0
msgid "Reference for further communication"
msgstr "Référence pour communication ultérieure"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa.wizard:0
msgid "Processing details"
msgstr "Paramètres"
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125
#, python-format
msgid "Field type error:"
msgstr "Erreur dans le type de champ:"
#. module: account_banking_sepa_credit_transfer
#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
@@ -200,69 +184,69 @@ msgid "SEPA export"
msgstr "Export SEPA"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:242
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:351
#, python-format
msgid ""
"Missing Bank Account on invoice '%s' (payment order line reference '%s')."
msgstr ""
msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')."
msgstr "Compte bancaire manquant sur la facture '%s' (référence de la ligne de paiement : '%s')."
#. 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 "Supportés par l'émetteur"
#: field:banking.export.sepa,file:0
#: field:banking.export.sepa.wizard,file_id:0
msgid "SEPA XML File"
msgstr "Fichier SEPA XML"
#. 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 "Nombre de transactions"
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:131
#, python-format
msgid "The '%s' is empty or 0. It should have a non-null value."
msgstr "Le '%s' est vide ou égal à 0. La valeur devrait être non nulle."
#. 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 "Suivant le niveau de service"
#: 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 "Suivant le niveau de service : la répartition des frais bancaires suit les règles pré-établies dans le schema ou dans le contrat avec la banque (les messages SEPA Core doivent utiliser ce paramètre). Partagés : les frais bancaires côté débiteur sont à la charge du débiteur, les frais bancaires côté créancier sont à la charge du créancier. Supportés par le créancier : tous les frais bancaires sont à la charge du créancier. Supportés par le débiteur : tous les frais bancaires sont à la charge du débiteur."
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:207
#, 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 "Le code du Type de paiement '%s' n'est pas supporté. Les seuls codes de Type de paiement supportés pour les virements SEPA sont 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' et 'pain.001.001.05'."
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
#, python-format
msgid "This IBAN is not valid : %s"
msgstr "Cet IBAN n'est pas valide : %s"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa:0
#: field:banking.export.sepa,payment_order_ids:0
#: field:banking.export.sepa.wizard,payment_order_ids:0
msgid "Payment Orders"
msgstr ""
msgstr "Ordres de paiement"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa:0
msgid "General Information"
msgstr ""
msgstr "Informations générales"
#. 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 "Répartition des frais"
#: 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 "Fichiers de virement SEPA"
#. 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 coché, le relevé de compte ne comportera qu'une ligne de débit pour tous "
"les virements du fichier SEPA XML ; si non coché, le relevé de compte "
"comportera une ligne de débit pour chaque virement du fichier SEPA XML."
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 coché, le relevé de compte ne comportera qu'une ligne de débit pour tous les virements du fichier SEPA XML ; si non coché, le relevé de compte comportera une ligne debit pour chaque virement du fichier SEPA XML."
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa.wizard,prefered_exec_date:0
msgid ""
"This is the date on which the file should be processed by the bank. Please "
"keep in mind that banks only execute on working days and typically use a "
"delay of two days between execution date and effective transfer date."
msgstr ""
"C'est la date à laquelle le fichier doit être traité par la banque. Gardez "
"en tête que les banques réalisent des traitements seulement les jours ouvrés "
"et ont habituellement un délai de 2 jours entre la date de traitement et la "
"date du transfert effectif."
msgid "This is the date on which the file should be processed by the bank. Please keep in mind that banks only execute on working days and typically use a delay of two days between execution date and effective transfer date."
msgstr "C'est la date à laquelle le fichier doit être traité par la banque. Gardez en tête que les banques réalisent des traitements seulement les jours ouvrés et ont habituellement un délai de 2 jours entre la date de traitement et la date du transfert effectif."
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa.wizard,file:0
@@ -275,34 +259,7 @@ msgid "Cancel"
msgstr "Annuler"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:132
#, 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' "
"and 'pain.001.001.04'."
msgstr ""
"Le code '%s' pour le Type de Paiment n'est pas supporté. Les seuls codes de "
"Types de Paiement supportés pour les virements SEPA sont 'pain.001.001.02', "
"'pain.001.001.03' et 'pain.001.001.04'."
#: field:banking.export.sepa,create_date:0
msgid "Generation Date"
msgstr "Date de génération"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:89
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:132
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:242
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:287
#, python-format
msgid "Error :"
msgstr "Erreur :"
#. 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 "Débit groupé"
#. module: account_banking_sepa_credit_transfer
#: 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 "Generated SEPA Credit Transfer XML files"
msgstr ""

View File

@@ -46,9 +46,6 @@ class banking_export_sepa_wizard(orm.TransientModel):
'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."),
'prefered_exec_date': fields.date(
'Prefered Execution Date',
help='This is the date on which the file should be processed by the bank. Please keep in mind that banks only execute on working days and typically use a delay of two days between execution date and effective transfer date.'),
'charge_bearer': fields.selection([
('SLEV', 'Following Service Level'),
('SHAR', 'Shared'),
@@ -98,26 +95,27 @@ class banking_export_sepa_wizard(orm.TransientModel):
cr, uid, vals, context=context)
def _prepare_field(
self, cr, uid, field_name, field_value, max_size=0,
sepa_export=False, line=False, context=None):
self, cr, uid, field_name, field_value, eval_ctx, max_size=0,
convert_to_ascii=False, context=None):
'''This function is designed to be inherited !'''
eval_ctx = {
'sepa_export': sepa_export,
'line': line,
}
assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict'
try:
value = safe_eval(field_value, eval_ctx)
# SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters
# But we are dealing with banks...
# and many banks don't want non-ASCCI characters !
# cf section 1.4 "Character set" of the SEPA Credit Transfer
# Scheme Customer-to-bank guidelines
value = unidecode(safe_eval(field_value, eval_ctx))
if convert_to_ascii:
value = unidecode(value)
except:
line = eval_ctx.get('line')
if line:
raise orm.except_orm(
_('Error:'),
_("Cannot compute the '%s' of the Payment Line with Invoice Reference '%s'.")
% (field_name, self.pool['account.invoice'].name_get(cr, uid, [line.ml_inv_ref.id], context=context)[0][1]))
% (field_name, self.pool['account.invoice'].name_get(
cr, uid, [line.ml_inv_ref.id], context=context)[0][1]))
else:
raise orm.except_orm(
_('Error:'),
@@ -142,7 +140,6 @@ class banking_export_sepa_wizard(orm.TransientModel):
return {
'batch_booking': sepa_export.batch_booking,
'charge_bearer': sepa_export.charge_bearer,
'prefered_exec_date': sepa_export.prefered_exec_date,
'total_amount': total_amount,
'nb_transactions': transactions_count,
'file': base64.encodestring(xml_string),
@@ -176,8 +173,12 @@ class banking_export_sepa_wizard(orm.TransientModel):
'''
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)
pain_flavor = sepa_export.payment_order_ids[0].mode.type.code
convert_to_ascii = \
sepa_export.payment_order_ids[0].mode.convert_to_ascii
if pain_flavor == 'pain.001.001.02':
bic_xml_tag = 'BIC'
name_maxsize = 70
@@ -208,11 +209,6 @@ class banking_export_sepa_wizard(orm.TransientModel):
_('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)
if sepa_export.prefered_exec_date:
my_requested_exec_date = sepa_export.prefered_exec_date
else:
my_requested_exec_date = fields.date.context_today(
self, cr, uid, context=context)
pain_ns = {
'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
@@ -221,11 +217,14 @@ class banking_export_sepa_wizard(orm.TransientModel):
root = etree.Element('Document', nsmap=pain_ns)
pain_root = etree.SubElement(root, root_xml_tag)
pain_03_to_05 = \
['pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05']
my_company_name = self._prepare_field(
cr, uid, 'Company Name',
'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name',
name_maxsize, sepa_export=sepa_export, context=context)
{'sepa_export': sepa_export}, name_maxsize,
convert_to_ascii=convert_to_ascii, context=context)
# A. Group header
group_header_1_0 = etree.SubElement(pain_root, 'GrpHdr')
@@ -233,8 +232,9 @@ class banking_export_sepa_wizard(orm.TransientModel):
group_header_1_0, 'MsgId')
message_identification_1_1.text = self._prepare_field(
cr, uid, 'Message Identification',
'sepa_export.payment_order_ids[0].reference', 35,
sepa_export=sepa_export, context=context)
'sepa_export.payment_order_ids[0].reference',
{'sepa_export': sepa_export}, 35,
convert_to_ascii=convert_to_ascii, context=context)
creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm')
creation_date_time_1_2.text = datetime.strftime(
datetime.today(), '%Y-%m-%dT%H:%M:%S')
@@ -253,77 +253,127 @@ class banking_export_sepa_wizard(orm.TransientModel):
initiating_party_1_8 = etree.SubElement(group_header_1_0, 'InitgPty')
initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm')
initiating_party_name.text = my_company_name
initiating_party_identifier = self.pool['res.company'].\
_get_initiating_party_identifier(
cr, uid, sepa_export.payment_order_ids[0].company_id.id,
context=context)
initiating_party_issuer = \
sepa_export.payment_order_ids[0].company_id.initiating_party_issuer
if initiating_party_identifier and initiating_party_issuer:
iniparty_id = etree.SubElement(initiating_party_1_8, 'Id')
iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId')
iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr')
iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id')
iniparty_org_other_id.text = initiating_party_identifier
iniparty_org_other_issuer = etree.SubElement(
iniparty_org_other, 'Issr')
iniparty_org_other_issuer.text = initiating_party_issuer
# B. Payment info
payment_info_2_0 = etree.SubElement(pain_root, 'PmtInf')
payment_info_identification_2_1 = etree.SubElement(
payment_info_2_0, 'PmtInfId')
payment_info_identification_2_1.text = self._prepare_field(
cr, uid, 'Payment Information Identification',
"sepa_export.payment_order_ids[0].reference",
35, sepa_export=sepa_export, context=context)
payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd')
payment_method_2_2.text = 'TRF'
if pain_flavor in [
'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05']:
# batch_booking is in "Group header" with pain.001.001.02
# and in "Payment info" in pain.001.001.03/04
batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg')
batch_booking_2_3.text = str(sepa_export.batch_booking).lower()
# It may seem surprising, but the
# "SEPA Credit Transfer Scheme Customer-to-bank Implementation
# guidelines" v6.0 says that control sum and nb_of_transactions
# should be present at both "group header" level and "payment info"
# level. This seems to be confirmed by the tests carried out at
# BNP Paribas in PAIN v001.001.03
if pain_flavor in [
'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05']:
nb_of_transactions_2_4 = etree.SubElement(
payment_info_2_0, 'NbOfTxs')
control_sum_2_5 = etree.SubElement(payment_info_2_0, 'CtrlSum')
payment_type_info_2_6 = etree.SubElement(payment_info_2_0, 'PmtTpInf')
service_level_2_8 = etree.SubElement(payment_type_info_2_6, 'SvcLvl')
service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd')
service_level_code_2_9.text = 'SEPA'
requested_exec_date_2_17 = etree.SubElement(
payment_info_2_0, 'ReqdExctnDt')
requested_exec_date_2_17.text = my_requested_exec_date
debtor_2_19 = etree.SubElement(payment_info_2_0, 'Dbtr')
debtor_name = etree.SubElement(debtor_2_19, 'Nm')
debtor_name.text = my_company_name
debtor_account_2_20 = etree.SubElement(payment_info_2_0, 'DbtrAcct')
debtor_account_id = etree.SubElement(debtor_account_2_20, 'Id')
debtor_account_iban = etree.SubElement(debtor_account_id, 'IBAN')
debtor_account_iban.text = self._validate_iban(
cr, uid, self._prepare_field(
cr, uid, 'Company IBAN',
'sepa_export.payment_order_ids[0].mode.bank_id.acc_number',
sepa_export=sepa_export, context=context),
context=context)
debtor_agent_2_21 = etree.SubElement(payment_info_2_0, 'DbtrAgt')
debtor_agent_institution = etree.SubElement(
debtor_agent_2_21, 'FinInstnId')
debtor_agent_bic = etree.SubElement(
debtor_agent_institution, bic_xml_tag)
# TODO validate BIC with pattern
# [A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}
# because OpenERP doesn't have a constraint on BIC
debtor_agent_bic.text = self._prepare_field(
cr, uid, 'Company BIC',
'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic',
sepa_export=sepa_export, context=context)
charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr')
charge_bearer_2_24.text = sepa_export.charge_bearer
transactions_count = 0
transactions_count_1_6 = 0
total_amount = 0.0
amount_control_sum = 0.0
# Iterate on payment orders
amount_control_sum_1_7 = 0.0
lines_per_group = {}
# key = (requested_exec_date, priority)
# values = list of lines as object
today = fields.date.context_today(self, cr, uid, context=context)
for payment_order in sepa_export.payment_order_ids:
total_amount = total_amount + payment_order.total
# Iterate each payment lines
for line in payment_order.line_ids:
transactions_count += 1
priority = line.priority
if payment_order.date_prefered == 'due':
requested_exec_date = line.ml_maturity_date or today
elif payment_order.date_prefered == 'fixed':
requested_exec_date = payment_order.date_scheduled or today
else:
requested_exec_date = today
if (requested_exec_date, priority) in lines_per_group:
lines_per_group[(requested_exec_date, priority)].append(line)
else:
lines_per_group[(requested_exec_date, priority)] = [line]
# Write requested_exec_date on 'Payment date' of the pay line
if requested_exec_date != line.date:
self.pool['payment.line'].write(
cr, uid, line.id,
{'date': requested_exec_date}, context=context)
for (requested_exec_date, priority), lines in lines_per_group.items():
# B. Payment info
payment_info_2_0 = etree.SubElement(pain_root, 'PmtInf')
payment_info_identification_2_1 = etree.SubElement(
payment_info_2_0, 'PmtInfId')
payment_info_identification_2_1.text = self._prepare_field(
cr, uid, 'Payment Information Identification',
"sepa_export.payment_order_ids[0].reference + '-' + requested_exec_date.replace('-', '') + '-' + priority", {
'sepa_export': sepa_export,
'priority': priority,
'requested_exec_date': requested_exec_date
}, 35, convert_to_ascii=convert_to_ascii, context=context)
payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd')
payment_method_2_2.text = 'TRF'
if pain_flavor in pain_03_to_05:
# batch_booking is in "Group header" with pain.001.001.02
# and in "Payment info" in pain.001.001.03/04
batch_booking_2_3 = etree.SubElement(
payment_info_2_0, 'BtchBookg')
batch_booking_2_3.text = str(sepa_export.batch_booking).lower()
# It may seem surprising, but the
# "SEPA Credit Transfer Scheme Customer-to-bank Implementation
# guidelines" v6.0 says that control sum and nb_of_transactions
# should be present at both "group header" level and "payment info"
# level. This seems to be confirmed by the tests carried out at
# BNP Paribas in PAIN v001.001.03
if pain_flavor in pain_03_to_05:
nb_of_transactions_2_4 = etree.SubElement(
payment_info_2_0, 'NbOfTxs')
control_sum_2_5 = etree.SubElement(payment_info_2_0, 'CtrlSum')
payment_type_info_2_6 = etree.SubElement(
payment_info_2_0, 'PmtTpInf')
if priority:
instruction_priority_2_7 = etree.SubElement(
payment_type_info_2_6, 'InstrPrty')
instruction_priority_2_7.text = priority
service_level_2_8 = etree.SubElement(
payment_type_info_2_6, 'SvcLvl')
service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd')
service_level_code_2_9.text = 'SEPA'
requested_exec_date_2_17 = etree.SubElement(
payment_info_2_0, 'ReqdExctnDt')
requested_exec_date_2_17.text = requested_exec_date
debtor_2_19 = etree.SubElement(payment_info_2_0, 'Dbtr')
debtor_name = etree.SubElement(debtor_2_19, 'Nm')
debtor_name.text = my_company_name
debtor_account_2_20 = etree.SubElement(
payment_info_2_0, 'DbtrAcct')
debtor_account_id = etree.SubElement(debtor_account_2_20, 'Id')
debtor_account_iban = etree.SubElement(debtor_account_id, 'IBAN')
debtor_account_iban.text = self._validate_iban(
cr, uid, self._prepare_field(
cr, uid, 'Company IBAN',
'sepa_export.payment_order_ids[0].mode.bank_id.acc_number',
{'sepa_export': sepa_export},
convert_to_ascii=convert_to_ascii, context=context),
context=context)
debtor_agent_2_21 = etree.SubElement(payment_info_2_0, 'DbtrAgt')
debtor_agent_institution = etree.SubElement(
debtor_agent_2_21, 'FinInstnId')
debtor_agent_bic = etree.SubElement(
debtor_agent_institution, bic_xml_tag)
# TODO validate BIC with pattern
# [A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}
# because OpenERP doesn't have a constraint on BIC
debtor_agent_bic.text = self._prepare_field(
cr, uid, 'Company BIC',
'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic',
{'sepa_export': sepa_export},
convert_to_ascii=convert_to_ascii, 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:
transactions_count_1_6 += 1
transactions_count_2_4 += 1
# C. Credit Transfer Transaction Info
credit_transfer_transaction_info_2_27 = etree.SubElement(
payment_info_2_0, 'CdtTrfTxInf')
@@ -332,17 +382,20 @@ class banking_export_sepa_wizard(orm.TransientModel):
end2end_identification_2_30 = etree.SubElement(
payment_identification_2_28, 'EndToEndId')
end2end_identification_2_30.text = self._prepare_field(
cr, uid, 'End to End Identification', 'line.name', 35,
line=line, context=context)
cr, uid, 'End to End Identification', 'line.name',
{'line': line}, 35, convert_to_ascii=convert_to_ascii,
context=context)
currency_name = self._prepare_field(
cr, uid, 'Currency Code', 'line.currency.name', 3,
line=line, context=context)
cr, uid, 'Currency Code', 'line.currency.name',
{'line': line}, 3, convert_to_ascii=convert_to_ascii,
context=context)
amount_2_42 = etree.SubElement(
credit_transfer_transaction_info_2_27, 'Amt')
instructed_amount_2_43 = etree.SubElement(
amount_2_42, 'InstdAmt', Ccy=currency_name)
instructed_amount_2_43.text = '%.2f' % line.amount_currency
amount_control_sum += line.amount_currency
amount_control_sum_1_7 += line.amount_currency
amount_control_sum_2_5 += line.amount_currency
creditor_agent_2_77 = etree.SubElement(
credit_transfer_transaction_info_2_27, 'CdtrAgt')
creditor_agent_institution = etree.SubElement(
@@ -355,14 +408,16 @@ class banking_export_sepa_wizard(orm.TransientModel):
creditor_agent_bic = etree.SubElement(
creditor_agent_institution, bic_xml_tag)
creditor_agent_bic.text = self._prepare_field(
cr, uid, 'Customer BIC', 'line.bank_id.bank.bic',
line=line, context=context)
cr, uid, 'Creditor BIC', 'line.bank_id.bank.bic',
{'line': line}, convert_to_ascii=convert_to_ascii,
context=context)
creditor_2_79 = etree.SubElement(
credit_transfer_transaction_info_2_27, 'Cdtr')
creditor_name = etree.SubElement(creditor_2_79, 'Nm')
creditor_name.text = self._prepare_field(
cr, uid, 'Customer Name', 'line.partner_id.name',
name_maxsize, line=line, context=context)
cr, uid, 'Creditor Name', 'line.partner_id.name',
{'line': line}, name_maxsize,
convert_to_ascii=convert_to_ascii, context=context)
creditor_account_2_80 = etree.SubElement(
credit_transfer_transaction_info_2_27, 'CdtrAcct')
creditor_account_id = etree.SubElement(
@@ -371,30 +426,71 @@ class banking_export_sepa_wizard(orm.TransientModel):
creditor_account_id, 'IBAN')
creditor_account_iban.text = self._validate_iban(
cr, uid, self._prepare_field(
cr, uid, 'Customer IBAN',
'line.bank_id.acc_number', line=line,
context=context),
cr, uid, 'Creditor IBAN',
'line.bank_id.acc_number', {'line': line},
convert_to_ascii=convert_to_ascii, context=context),
context=context)
remittance_info_2_91 = etree.SubElement(
credit_transfer_transaction_info_2_27, 'RmtInf')
# switch to Structured (Strdr) ?
# If we do it, beware that the format is not the same
# between pain 02 and pain 03
remittance_info_unstructured_2_99 = etree.SubElement(
remittance_info_2_91, 'Ustrd')
remittance_info_unstructured_2_99.text = self._prepare_field(
cr, uid, 'Remittance Information', 'line.communication',
140, line=line, context=context)
if line.state == 'normal':
remittance_info_unstructured_2_99 = etree.SubElement(
remittance_info_2_91, 'Ustrd')
remittance_info_unstructured_2_99.text = \
self._prepare_field(
cr, uid, 'Remittance Unstructured Information',
'line.communication', {'line': line}, 140,
convert_to_ascii=convert_to_ascii,
context=context)
else:
if not line.struct_communication_type:
raise orm.except_orm(
_('Error:'),
_("Missing 'Structured Communication Type' on payment line with your reference '%s'.")
% (line.name))
remittance_info_unstructured_2_100 = etree.SubElement(
remittance_info_2_91, 'Strd')
creditor_ref_information_2_120 = etree.SubElement(
remittance_info_unstructured_2_100, 'CdtrRefInf')
if pain_flavor in pain_03_to_05:
creditor_ref_info_type_2_121 = etree.SubElement(
creditor_ref_information_2_120, 'Tp')
creditor_ref_info_type_or_2_122 = etree.SubElement(
creditor_ref_info_type_2_121, 'CdOrPrtry')
creditor_ref_info_type_code_2_123 = etree.SubElement(
creditor_ref_info_type_or_2_122, 'Cd')
creditor_ref_info_type_issuer_2_125 = etree.SubElement(
creditor_ref_info_type_2_121, 'Issr')
creditor_reference_2_126 = etree.SubElement(
creditor_ref_information_2_120, 'Ref')
else:
creditor_ref_info_type_2_121 = etree.SubElement(
creditor_ref_information_2_120, 'CdtrRefTp')
creditor_ref_info_type_code_2_123 = etree.SubElement(
creditor_ref_info_type_2_121, 'Cd')
creditor_ref_info_type_issuer_2_125 = etree.SubElement(
creditor_ref_info_type_2_121, 'Issr')
creditor_reference_2_126 = etree.SubElement(
creditor_ref_information_2_120, 'CdtrRef')
if pain_flavor in [
'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05']:
nb_of_transactions_1_6.text = nb_of_transactions_2_4.text = \
str(transactions_count)
control_sum_1_7.text = control_sum_2_5.text = \
'%.2f' % amount_control_sum
creditor_ref_info_type_code_2_123.text = 'SCOR'
creditor_ref_info_type_issuer_2_125.text = \
line.struct_communication_type
creditor_reference_2_126.text = \
self._prepare_field(
cr, uid, 'Creditor Structured Reference',
'line.communication', {'line': line}, 35,
convert_to_ascii=convert_to_ascii,
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)
control_sum_1_7.text = '%.2f' % amount_control_sum
nb_of_transactions_1_6.text = str(transactions_count_1_6)
control_sum_1_7.text = '%.2f' % amount_control_sum_1_7
xml_string = etree.tostring(
root, pretty_print=True, encoding='UTF-8', xml_declaration=True)
@@ -407,7 +503,7 @@ class banking_export_sepa_wizard(orm.TransientModel):
# CREATE the banking.export.sepa record
file_id = self.pool.get('banking.export.sepa').create(
cr, uid, self._prepare_export_sepa(
cr, uid, sepa_export, total_amount, transactions_count,
cr, uid, sepa_export, total_amount, transactions_count_1_6,
xml_string, context=context),
context=context)

View File

@@ -15,7 +15,6 @@
<field name="state" invisible="True"/>
<group states="create">
<field name="batch_booking" />
<field name="prefered_exec_date" />
<field name="charge_bearer" />
</group>
<group states="finish">