summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJason Van Malder <jvm@odoo.com>2020-01-16 09:32:38 +0000
committerNicolas Martinelli <nim@odoo.com>2020-01-17 15:38:11 +0000
commitc6dff462035feb4d949a646c05ae4e2e8092c224 (patch)
treef82f6f63575f0aafb158bdb14436f4c61f745c40 /addons
parent7253c339567b1e0b62b8f1e6b0d314af1fe2f4e3 (diff)
[FIX] account_facturx: fix too much restrictive XML bill upload
Issue - Install Accounting - Upload XML bill (tried with a MX one) No decoder was found. Cause The _create_invoice_from_xml method gets decoders from overrides of _get_xml_decoders. There is only 2 overrides: Belgium & Italy. All others countries are not handled. So, this error blocks the user. Solution Log the error instead raising it. (Reproduce V12 behavior) OPW-2170516 closes odoo/odoo#43503 X-original-commit: 592d2a296e4aa6a0c96bb1e56119965cd066ea0f Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account_facturx/models/account_move.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/account_facturx/models/account_move.py b/addons/account_facturx/models/account_move.py
index 7f509b42b69..bc80f157aa4 100644
--- a/addons/account_facturx/models/account_move.py
+++ b/addons/account_facturx/models/account_move.py
@@ -299,7 +299,7 @@ class AccountMove(models.Model):
try:
tree = etree.fromstring(content)
except Exception:
- raise UserError(_('The xml file is badly formatted : {}').format(attachment.name))
+ _logger.exception('The xml file is badly formatted : {}'.format(attachment.name))
for xml_type, check_func, decode_func in decoders:
check_res = check_func(tree, attachment.name)
@@ -313,7 +313,7 @@ class AccountMove(models.Model):
try:
return invoice_ids
except UnboundLocalError:
- raise UserError(_('No decoder was found for the xml file: {}. The file is badly formatted, not supported or the decoder is not installed').format(attachment.name))
+ _logger.exception('No decoder was found for the xml file: {}. The file is badly formatted, not supported or the decoder is not installed'.format(attachment.name))
def _remove_ocr_option(self):
if 'extract_state' in self: