[16.0] Installation Error of account_analytic_distribution_manual
Module
account_analytic_distribution_manual
Describe the bug
The installation fails with the following error message:
psycopg2.errors.UndefinedColumn: column tag.active_analytic_distribution does not exist
LINE 10: WHERE tag.active_analytic_distribution = true
^
To Reproduce
Affected versions: 16.0
Steps to reproduce the behavior: Install Odoo 16 without any HR-related modules. Attempt to install the account_analytic_distribution_manual module.
Expected behavior The account_analytic_distribution_manual module should install successfully without requiring HR modules.
Workaround: Installing the hr_timesheet_analytic_tag module before installing account_analytic_distribution_manual resolves the issue.
Possible solution:
Add "hr_timesheet_analytic_tag" to the depends section of the module's manifest.py file:
"depends": [
"account",
"hr_timesheet_analytic_tag",
],
However, this approach forces the installation of HR modules, which may not be desirable for all users.
Alternatively, create an intermediary module that bridges account_analytic_distribution_manual and HR functionalities, avoiding direct dependency on HR modules.
Additional context The error occurs because the field active_analytic_distribution does not exist in the account.analytic.tag model unless the hr_timesheet_analytic_tag module is installed. This field is required by account_analytic_distribution_manual during installation.