Browse Source

Remove the auto-delete lines with 0 amount (feature now provided by the module account_bank_statement_import)

pull/200/head
Alexis de Lattre 8 years ago
committed by Benjamin
parent
commit
e941f0dfdd
  1. 9
      account_bank_statement_import_ofx/wizard/account_bank_statement_import.py

9
account_bank_statement_import_ofx/wizard/account_bank_statement_import.py

@ -5,7 +5,6 @@ import StringIO
from odoo import api, models, _ from odoo import api, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
from odoo.tools import float_is_zero
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@ -32,14 +31,6 @@ class AccountBankStatementImport(models.TransientModel):
@api.model @api.model
def _prepare_ofx_transaction_line(self, transaction): def _prepare_ofx_transaction_line(self, transaction):
# since odoo 9, the account module defines a constraint
# on account.bank.statement.line: 'amount' must be != 0
# But some banks have some transactions with amount=0
# for bank charges that are offered, which blocks the import
precision = self.env['decimal.precision'].precision_get('Account')
if float_is_zero(
float(transaction.amount), precision_digits=precision):
return False
# Since ofxparse doesn't provide account numbers, # Since ofxparse doesn't provide account numbers,
# we cannot provide the key 'bank_account_id', # we cannot provide the key 'bank_account_id',
# nor the key 'account_number' # nor the key 'account_number'

Loading…
Cancel
Save