| .. | ||
| models | ||
| tests | ||
| views | ||
| __init__.py | ||
| __manifest__.py | ||
| README.md | ||
Project Task Analytic Account Sync
This module forces the analytic account of every project task to always be the same as the one defined on its project. It removes the possibility of manual divergences introduced by the is_analytic_account_id_changed flag in Odoo core.
Behavior
- Task creation: When a task is created and assigned to a project, its
analytic_account_idis set to the project's analytic account. - Project change: When a task is moved to another project, its analytic account is updated to the new project's account.
- Project analytic account change: When a project's analytic account is modified, the change is propagated to all existing tasks (active and archived).
- Manual override ignored: Writing a different analytic account directly on a task is immediately reverted.
- Analytic account auto-creation: When Odoo auto-creates a project analytic account, the existing tasks are synchronized.
Usage
No user action is required. The synchronization is transparent and enforced server-side.
Technical notes
- The
analytic_account_idfield onproject.taskis kept as a computed stored field but the compute is overridden to always ignoreis_analytic_account_id_changed. project.project.writedetects changes inanalytic_account_idand propagates them in batch.project.task.writedetects changes inproject_idoranalytic_account_idand corrects the value immediately.- The task form view makes the analytic account field readonly to avoid confusion.