Closed lmignon closed 4 months ago
@sbidoul The issue is maybe into the way odoo imports the addons into the python path... At least it seems that we are no more ensured that an addon an other addon depend on is already imported into the python path when the last one is imported.
This seems to be on Odoo bug. Indeed, sometimes even if I declare base_sparse_field into the server_wide_module, the normal server startup fails...
So we can close this one?
yes we can
Without this change even if an addon is declared as server wide module, the import is not done before others addons. With this change we solve a problem with addons depending of base_sparse_field. base_sparse_field, patch the odoo.fields module to add the Serialized field. When an addon depends on base_sparse_field, the common way to declare a Serialized field is to write:
Unfortunately we observe in some cases that even if the addon is declared as a dependency of the addon using this kind of field, the code of the base_sparse_field is not yet imported when the addon is added into the python path and an AttributeError is raised: AttributeError: module 'odoo.fields' has no attribute 'Serialized'
A way to fix this issue at server startup is to delare base_spare_field as server_wide_addon. Unfortunately, this parameter was ignored by click-doo before this change.
Observed with Odoo 13.0