mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[FIX] don't cause a warning for the data key (#148)
This commit is contained in:
committed by
Pedro M. Baeza
parent
c6968ace1c
commit
d62713d06f
@@ -185,12 +185,14 @@ class CamtParser(models.AbstractModel):
|
|||||||
self.parse_transaction_details(ns, dnode, transaction)
|
self.parse_transaction_details(ns, dnode, transaction)
|
||||||
# transactions['data'] should be a synthetic xml snippet which
|
# transactions['data'] should be a synthetic xml snippet which
|
||||||
# contains only the TxDtls that's relevant.
|
# contains only the TxDtls that's relevant.
|
||||||
data = copy(node)
|
# only set this field if statement lines have it
|
||||||
for j, dnode in enumerate(data.xpath(
|
if 'data' in self.pool['account.bank.statement.line']._fields:
|
||||||
'./ns:NtryDtls/ns:TxDtls', namespaces={'ns': ns})):
|
data = copy(node)
|
||||||
if j != i:
|
for j, dnode in enumerate(data.xpath(
|
||||||
dnode.getparent().remove(dnode)
|
'./ns:NtryDtls/ns:TxDtls', namespaces={'ns': ns})):
|
||||||
transaction['data'] = etree.tostring(data)
|
if j != i:
|
||||||
|
dnode.getparent().remove(dnode)
|
||||||
|
transaction['data'] = etree.tostring(data)
|
||||||
yield transaction
|
yield transaction
|
||||||
|
|
||||||
def get_balance_amounts(self, ns, node):
|
def get_balance_amounts(self, ns, node):
|
||||||
|
|||||||
Reference in New Issue
Block a user