~therp-nl/banking-addons/6.1_mt940_line_endings

« back to all changes in this revision

Viewing changes to account_banking_sepa_credit_transfer/wizard/export_sepa.py

  • Committer: Holger Brunn
  • Author(s): stefan at therp
  • Date: 2013-10-28 14:51:41 UTC
  • mfrom: (178.5.3 6.1-sepa-fixes)
  • Revision ID: hbrunn@therp.nl-20131028145141-g8hj0mduqbgyrowu
[FIX] Wizard should not have ACL
[FIX] Undefined reference to orm.except_orm

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        sepa_export = self.browse(cr, uid, ids[0], context=context)
108
108
 
109
109
        my_company_name = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name
110
 
        my_company_iban = self._validate_iban(cr, uid, sepa_export.payment_order_ids[0].mode.bank_id.iban, context=context)
 
110
        my_company_iban = self._validate_iban(cr, uid, sepa_export.payment_order_ids[0].mode.bank_id.acc_number, context=context)
111
111
        my_company_bic = sepa_export.payment_order_ids[0].mode.bank_id.bank.bic
112
112
        #my_company_country_code = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].country_id.code
113
113
        #my_company_city = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].city
260
260
                creditor_account = etree.SubElement(credit_transfer_transaction_info, 'CdtrAcct')
261
261
                creditor_account_id = etree.SubElement(creditor_account, 'Id')
262
262
                creditor_account_iban = etree.SubElement(creditor_account_id, 'IBAN')
263
 
                creditor_account_iban.text = self._validate_iban(cr, uid, line.bank_id.iban, context=context)
 
263
                creditor_account_iban.text = self._validate_iban(cr, uid, line.bank_id.acc_number, context=context)
264
264
                remittance_info = etree.SubElement(credit_transfer_transaction_info, 'RmtInf')
265
265
                # switch to Structured (Strdr) ? If we do it, beware that the format is not the same between pain 02 and pain 03
266
266
                remittance_info_unstructured = etree.SubElement(remittance_info, 'Ustrd')
280
280
        official_pain_schema = etree.XMLSchema(etree.parse(tools.file_open('account_banking_sepa_credit_transfer/data/%s.xsd' % pain_flavor)))
281
281
 
282
282
        try:
283
 
            official_pain_schema.validate(root)
 
283
            root_to_validate = etree.fromstring(xml_string)
 
284
            official_pain_schema.assertValid(root_to_validate)
284
285
        except Exception, e:
285
286
            _logger.warning("The XML file is invalid against the XML Schema Definition")
286
287
            _logger.warning(xml_string)