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

This commit is contained in:
Alexis de Lattre
2017-03-29 16:26:52 +02:00
committed by Benjamin
parent 800047b1a8
commit e941f0dfdd

View File

@@ -5,7 +5,6 @@ import StringIO
from odoo import api, models, _
from odoo.exceptions import UserError
from odoo.tools import float_is_zero
_logger = logging.getLogger(__name__)
@@ -32,14 +31,6 @@ class AccountBankStatementImport(models.TransientModel):
@api.model
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,
# we cannot provide the key 'bank_account_id',
# nor the key 'account_number'