Daily updates from Odoo
Wednesday, March 20, 2024
1 change
Resolved issues and error corrections
This update resolves memory errors that occurred when installing the Mexican EDI module on large databases. The fix optimizes how payment method information is processed during installation by creating the necessary database column upfront and then properly setting payment method values after the module's data files are loaded, preventing the system from running out of memory.
Original PR description
The computed stored field l10n_mx_edi_payment_method_id of account_move in l10n_mx_edi can lead to MemoryErrors during module installation in some large databases. To fix that, this commit first creates the field's column in _auto_init, avoiding the recomputations that overfill the field_cache and lead to MemoryErrors. Then, since inside the field's compute method the field should be set to a specific payment_method defined in the module's data files, change the post_init_hook to set the payment_method to the correct id in the database after data files loading. I missed it in PR odoo/enterprise#30929 because this field was changed to a computed field starting v15. opw-3018535 Forward-Port-Of: odoo/enterprise#58495 Forward-Port-Of: odoo/enterprise#34974