From 0d31e607725ad7ee233648fd419e047bbab15ed1 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Wed, 22 Jan 2025 12:16:04 +0100 Subject: [PATCH] fix check of invoice, fix read of trade_country --- document.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/document.py b/document.py index ec56906..1c8f3f6 100644 --- a/document.py +++ b/document.py @@ -109,8 +109,9 @@ class Incoming(metaclass=PoolMeta): ('taxbase', 'untaxed_amount'), ('taxtotal', 'tax_amount'), ('grand', 'total_amount')]: - xml_val = totals.get('taxbase', Decimal('0.0')) + xml_val = totals.get(xfield, Decimal('0.0')) inv_val = getattr(invoice, inv_field) + if xml_val != inv_val: raise UserError(gettext( 'document_incoming_invoice_xml.msg_convert_error', @@ -853,7 +854,8 @@ class Incoming(metaclass=PoolMeta): (['ram:OriginTradeCountry', 'ram:ID'], 'trade_country') ]: result[key] = self._readxml_getvalue(xmldata, xpath_line + [ - 'ram:SpecifiedTradeProduct', xkey]) + 'ram:SpecifiedTradeProduct'] + + (xkey if isinstance(xkey, list) else [xkey])) # attributes of product result['attributes'] = self._readxml_read_listdata(