Use root prefix to retrieve the namespace of UBL document
Closes #14490
This commit is contained in:
@@ -200,7 +200,7 @@ class Invoice(Model):
|
||||
|
||||
tree = etree.parse(BytesIO(document))
|
||||
root = tree.getroot()
|
||||
namespace = root.nsmap.get(None)
|
||||
namespace = root.nsmap.get(root.prefix)
|
||||
invoice, attachments = cls.parser(namespace)(root)
|
||||
invoice.save()
|
||||
invoice.update_taxes()
|
||||
|
||||
Reference in New Issue
Block a user