Thursday, December 28, 2023
1 change · 17.0
Resolved issues and error corrections
This fix resolves a critical issue that was causing database upgrades to fail when the file storage system becomes temporarily unavailable. When processing Mexican EDI invoice payments, the system now gracefully handles missing file attachments instead of crashing, allowing upgrades to complete successfully.
Original PR description
In `_l10n_mx_edi_cfdi_invoice_get_payments_diff()`: If the filestore is not available (e.g. during upgrades or for any other reason), `ir_attachment.raw` computation returns an empty byte string. Passing that to `lxml.etree.fromstring()`, causes `lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1`. The upgrade of serveral DBs fails because of this (tbg-978). Since in that situation it is unclear why the attachment is empty, it is best to leave the state as is and continue to the next payment. Forward-Port-Of: odoo/enterprise#53162