Files
odoo_source/addons/project/tests/__init__.py
T
Victor Piryns (pivi) dd2fdcef05 [FIX] project: set default analytic plan in settings
Current behaviour:
You cannot set the Default Analytic Plan for projects in the settings.

Expected behaviour:
You should be able to set the default plan, like any other settings.

Steps to reproduce:
- Install Accounting, Project, (Timesheets if you want to test
  project creation with an auto-created analytic account)
- Settings > Check Analytic Accounts
- Try to change the Default Plan in Settings > Project
- Upon saving, the change is lost

Reason for the problem:
The `analytic_plan_id` in the project's `res.config.settings` is
related to the same field on the `res.company` model.
The `analytic_plan_id` that is set on the company upon installing the
project module is a non-stored computed field, which makes a call to a
`_get_default` -> the field cannot be set. It will always return
the first default plan in the sequence.

Fix:
Since the field isn't stored (which would have worked if it was),
we use `ir.config_parameter` to write and read to it, per company.
In master we should just add a `store=True` and write a migration
for it?

Affected versions:
- 16.0
- saas-16.1
- master

opw-3127638

closes odoo/odoo#111635

X-original-commit: 11b0e2556ce824048bb4c760893b05e98537d171
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-02 00:28:12 +01:00

28 lines
922 B
Python

# -*- coding: utf-8 -*-
from . import test_access_rights
from . import test_burndown_chart
from . import test_project_base
from . import test_project_config
from . import test_project_flow
from . import test_project_milestone
from . import test_project_profitability
from . import test_project_recurrence
from . import test_project_sharing
from . import test_project_sharing_portal_access
from . import test_project_sharing_ui
from . import test_project_subtasks
from . import test_project_task_type
from . import test_project_ui
from . import test_project_update_access_rights
from . import test_project_update_flow
from . import test_project_update_ui
from . import test_portal
from . import test_multicompany
from . import test_personal_stages
from . import test_res_config_settings
from . import test_task_dependencies
from . import test_task_follow
from . import test_task_tracking
from . import test_project_report