Hello everyone,
I have a custom Odoo module that adds a new field to the account.move model using _inherit = 'account.move'. Inside my module’s Python file, I define the field (e.g., fields.Char) and a compute method. If I place this module folder into the Odoo addons directory (or specify the path via the command line) and then install/upgrade from the Apps menu, the field is recognized on account.move with no problems.
However, if I take that same module folder, zip it up, and use the “Import Module” feature in Odoo’s web interface, it says “Successfully imported module,” but the Python logic doesn’t seem to load. Whenever I try to access the custom field in a QWeb report (or anywhere else), I get an error like:
AttributeError: 'account.move' object has no attribute '<my_field_name>'
It appears that the .py code for my module never actually executes in this scenario, even though the module is marked as installed. I’ve confirmed that my zip includes the standard structure (__init__.py, __manifest__.py, models/, etc.).
My questions are:
- Is the “Import Module from ZIP” feature in certain Odoo versions limited to XML/data files, ignoring custom Python code?
- If so, is there any workaround to get Python inheritance and fields to register without manually placing the folder in addons_path?
- Are there certain hosting environments or Odoo configurations that fully support importing Python modules from a zip?
Thanks in advance for any insights or suggestions! Any experiences dealing with this limitation or recommended best practices would be greatly appreciated.