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(