</field>
</record>
- <record id="account_coda_import_result_view" model="ir.ui.view">
- <field name="name">Import CODA File</field>
- <field name="model">account.coda.import</field>
- <field name="priority">2</field>
- <field name="arch" type="xml">
- <form string="Import CODA File" version="7.0">
- <header>
- <button name="action_open_coda_statements" string="View CODA Bank Statement(s)" type="object" class="oe_highlight"/>
- <button name="action_open_bank_statements" string="View Bank Statement(s)" type="object" class="oe_highlight"/>
- or
- <button string="Cancel" class="oe_link" special="cancel"/>
- </header>
- <group string="Results :">
- <field name="note" nolabel="1" colspan="2"/>
- </group>
- </form>
- </field>
- </record>
-
<record id="action_account_coda_import" model="ir.actions.act_window">
<field name="name">Import CODA File</field>
<field name="type">ir.actions.act_window</field>
raise osv.except_osv(_('Error') + 'R1002', _('Foreign bank accounts with IBAN structure are not supported '))
else: # Something else, not supported
raise osv.except_osv(_('Error') + 'R1003', _('Unsupported bank account structure '))
- ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', statement['acc_number'])])
+ bank_ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', statement['acc_number'])])
not_found_except = osv.except_osv(_('Error') + 'R1004', _("No matching CODA Bank Account Configuration record found. Please check if the 'Bank Account Number' and 'Currency' fields of your configuration record match with '%s' and '%s'.") % (statement['acc_number'], statement['currency']))
- if ids and len(ids) > 0:
- bank_accs = self.pool.get('res.partner.bank').browse(cr, uid, ids)
+ if bank_ids and len(bank_ids) > 0:
+ bank_accs = self.pool.get('res.partner.bank').browse(cr, uid, bank_ids)
for bank_acc in bank_accs:
statement['journal_id'] = bank_acc.journal_id
if (statement['journal_id'].currency and statement['journal_id'].currency.name != statement['currency']) and (not statement['journal_id'].currency and statement['journal_id'].company_id.currency_id.name != statement['currency']):
line['transaction_family'] = transaction_family[0]
if line['transaction_code'] in transaction_family[1]:
line['transaction_code'] = transaction_family[1][line['transaction_code']]
- statement['coda_note'] = "\n".join([statement['coda_note'], line['type'].title() + ' #' + str(line['sequence']), 'Date: ' + str(line['entryDate']), 'Ref: ' + str(line['ref']), 'Communication: ' + line['communication'],'\n'])
+ statement['coda_note'] = "\n".join([statement['coda_note'], line['type'].title() + ' #' + str(line['sequence']), 'Date: ' + str(line['entryDate']), 'Ref: ' + str(line['ref']), 'Communication: ' + line['communication'], '\n'])
elif line['type'] == 'communication':
- statement['coda_note'] = "\n".join([statement['coda_note'], line['type'].title() + ' #' + str(line['sequence']), 'Ref: ' + str(line['ref']), 'Communication: ' + line['communication'],'\n'])
+ statement['coda_note'] = "\n".join([statement['coda_note'], line['type'].title() + ' #' + str(line['sequence']), 'Ref: ' + str(line['ref']), 'Communication: ' + line['communication'], '\n'])
elif line['type'] == 'normal':
note = []
if 'counterpartyName' in line and line['counterpartyName'] != '':
self.pool.get('account.bank.statement.line').create(cr, uid, data, context=context)
if statement['coda_note'] != '':
self.pool.get('account.bank.statement').write(cr, uid, [statement['id']], {'coda_note': statement['coda_note']}, context=context)
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'tree',
+ 'res_model': 'account.bank.statement',
+ 'view_id': False,
+ 'context': context,
+ 'type': 'ir.actions.act_window',
+ }
account_coda_import()
transaction_types = {