Browse Source

FIX when transaction.payee is not set: don't detect wrong bank_account/partner (it used to match that res.partner.bank that have an empty 'owner_name')

pull/54/head
Alexis de Lattre 9 years ago
parent
commit
606e32c6ad
  1. 1
      account_bank_statement_import_ofx/account_bank_statement_import_ofx.py

1
account_bank_statement_import_ofx/account_bank_statement_import_ofx.py

@ -45,6 +45,7 @@ class AccountBankStatementImport(models.TransientModel):
# (normal behavious is to provide 'account_number', which the # (normal behavious is to provide 'account_number', which the
# generic module uses to find partner/bank) # generic module uses to find partner/bank)
bank_account_id = partner_id = False bank_account_id = partner_id = False
if transaction.payee:
banks = self.env['res.partner.bank'].search( banks = self.env['res.partner.bank'].search(
[('owner_name', '=', transaction.payee)], limit=1) [('owner_name', '=', transaction.payee)], limit=1)
if banks: if banks:

Loading…
Cancel
Save