Conversation
05b3726 to
d9e36e0
Compare
|
tests fail because of sale_project_task_selection |
alexey-pelykh
left a comment
There was a problem hiding this comment.
Thanks for the contribution! A couple of things on top of the tests request from @luisDIXMIT.
d9e36e0 to
e7b8647
Compare
alexey-pelykh
left a comment
There was a problem hiding this comment.
Looks good, all three points addressed. Tests would be a nice addition to cover the constraint and the computed progress — not blocking but would help with long-term maintenance.
alexey-pelykh
left a comment
There was a problem hiding this comment.
Review: project_task_manual_progress (18.0)
This PR is currently marked as Draft, so this is an early-stage review to provide constructive feedback before the PR is ready for formal review.
The module idea is sound -- providing a manual "intuition-based" progress field for tasks is a useful complement to the timesheet-based progress. Here are findings to address before moving out of draft.
Critical: No tests
OCA requires test coverage for new modules. At minimum, tests should cover:
- Creating a task, setting
manual_progress, verifying the constraint (0-100 range) - Verifying the project-level
_compute_manual_progresscorrectly averages task progress - Edge case: project with no tasks (division by zero is handled, but should be tested)
Critical: Missing installable key in manifest
While installable defaults to True, OCA convention requires it to be explicitly set in __manifest__.py.
Important: Project progress computation includes all tasks
project.task_ids includes all tasks (including subtasks in Odoo 18). Tasks with manual_progress = 0 (the default) will drag down the project average. Consider:
- Filtering to only tasks that have been explicitly rated (e.g.,
manual_progress > 0), or - Documenting that this is intentional behavior, or
- Using a weighted approach
Also, task_ids may include tasks in folded/cancelled stages -- is that desired?
Important: Computed field not stored
manual_progress on project.project is not stored. For projects with many tasks this will recompute on every access. Consider adding store=True and appropriate dependencies, which also enables searching/grouping by progress.
Moderate: Deprecated <field name="type"> in view XML
In Odoo 18, the <field name="type">form</field> / <field name="type">list</field> attributes on ir.ui.view records are deprecated. The view type is inferred from the inherit_id. Remove these lines from both project_project_views.xml and project_task_views.xml.
Minor: Typo in CONTRIBUTORS.md
The contributor line has an extra > character:
- Cyril VINH-TUNG \<cyril@invitu.com>\>
Should be:
- Cyril VINH-TUNG <cyril@invitu.com>
The same typo appears in README.rst.
Minor: No .pot file
A translatable string exists in project_task.py (the validation error message). Run oca-gen-addon-readme and export translations to generate the .pot file.
Minor: Missing development_status in manifest
The README badges show "Beta" but the manifest does not include "development_status": "Beta". Adding it ensures consistency.
Suggestion: Consider group_operator for list view aggregation
The task list view uses avg="Average of Progress" on the manual_progress field. In Odoo 18, you may want to set group_operator="avg" on the field definition itself so that grouping in list view correctly shows averages.
Summary: The concept is good but the module needs tests, a few model design decisions to be clarified (stored vs. computed, task filtering), and some OCA packaging fixes before it can be considered for merge.
Review posted via CorporateHub OCA review campaign
| help="Shows the progress of the project based on the task manual progress", | ||
| ) | ||
|
|
||
| @api.depends("task_ids.manual_progress") |
There was a problem hiding this comment.
Depending on task_ids.manual_progress will trigger recomputation for ANY task change in the project. In Odoo 18, task_ids may include subtasks as well.
Consider whether you want to:
- Filter out subtasks or tasks in specific stages
- Only average tasks where
manual_progress > 0(so unrated tasks don't drag the average to 0) - Document the current behavior as intentional
e7b8647 to
4b24c00
Compare
4b24c00 to
1f7aba8
Compare
This module allows to manually enter a 'based on intuition' progress in tasks.
The global project manual progress is calculated from tasks manual progress.
This progress value is not related to time spent on tasks as it is in hr_timesheet.