Skip to content

[16.0][ADD] document_page_project_task: add new module#564

Open
marcelsavegnago wants to merge 1 commit intoOCA:16.0from
Escodoo:16.0-add-documento_page_projet_task
Open

[16.0][ADD] document_page_project_task: add new module#564
marcelsavegnago wants to merge 1 commit intoOCA:16.0from
Escodoo:16.0-add-documento_page_projet_task

Conversation

@marcelsavegnago
Copy link
Member

@marcelsavegnago marcelsavegnago commented Nov 6, 2025

This module extends the document page (wiki) functionality by allowing you to link them directly to project tasks.

Main Features

  • Link Wiki Pages to Tasks: Allows associating document pages to specific project tasks
  • Automatic Project Filling: When a task is selected, the related project is automatically filled
  • Consistency Validation: Ensures that the wiki page's project is always the same as the linked task's project
  • Smart Filtering: When a project is defined, only tasks from that project are displayed for selection
  • Page Counter: Displays the number of wiki pages linked to each task directly in the task view

Benefits

  • Organize project documentation hierarchically (Project → Task → Wiki)
  • Keep documentation close to the work context (tasks)
  • Avoid inconsistencies between projects and tasks through automatic validations
  • Quickly access documentation related to a specific task

Dependencies

This module requires:

  • document_page_project: Module that links document pages to projects
  • project: Odoo's project management module

cc @parzewski @kaynnan

@marcelsavegnago marcelsavegnago force-pushed the 16.0-add-documento_page_projet_task branch 4 times, most recently from eb1b1d8 to 287c617 Compare November 12, 2025 03:48
@marcelsavegnago marcelsavegnago marked this pull request as ready for review November 12, 2025 03:50
@marcelsavegnago
Copy link
Member Author

ping @LoisRForgeFlow

@kaynnan
Copy link
Contributor

kaynnan commented Nov 17, 2025

cc @CristianoMafraJunior

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link

@WesleyOliveira98 WesleyOliveira98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@marcos-mendez marcos-mendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Review -- Tests Failed

1. Root cause of the test failure

The test failure occurs because the database connection fails during the Odoo startup process, likely due to a misconfiguration or missing environment setup in the test environment (Runboat). This is not a code issue but a test infrastructure problem.


2. Suggested fix

There is no code fix needed for the test failure itself, as it's unrelated to the module logic. However, ensure that:

  • The test environment (Runboat) has proper access to PostgreSQL.
  • The database configuration in odoo.conf or environment variables is correct.
  • The odoo binary is correctly installed and executable in the test container.

3. Additional code issues

Missing project dependency in manifest

In document_page_project_task/__manifest__.py, the module depends on document_page_project but does not explicitly depend on the base project module, which is required by document_page_project.

File: document_page_project_task/__manifest__.py
Line: 13
Issue: Missing "project" in depends

Fix: Add "project" to the depends list.

"depends": ["document_page_project", "project"],

4. Test improvements

To improve test coverage for this module, the following test cases should be added:

Test default_get with default_task_id context

Use TransactionCase to test that when a default_task_id is passed in the context, the project_id is correctly set on the new document page.

Suggested test method:
test_default_get_with_task_id

Test consistency constraints

Use SavepointCase to test:

  • That a ValidationError is raised when linking a task to a document page with a mismatched project.
  • That a ValidationError is raised when a task is linked but no project is set on the document page.

Suggested test methods:
test_consistency_constraint_task_without_project
test_consistency_constraint_project_mismatch

Test automatic clearing of task when project changes

Use TransactionCase to test that when a document page's project is changed and no longer matches the linked task's project, the task_id is cleared.

Suggested test method:
test_task_cleared_on_project_change

Test document_page_count computation

Use TransactionCase to ensure that document_page_count is correctly computed when document pages are linked to a task.

Suggested test method:
test_document_page_count_computation


Summary of OCA Testing Patterns

  • Use TransactionCase for most functional tests.
  • Use SavepointCase for tests involving constraints or data integrity.
  • Tag tests using @tagged('post_install', 'manual') if they are not part of the standard test suite.

These tests should be placed in a tests/test_document_page_project_task.py file.


⏰ PR Aging Alert

This PR by @marcelsavegnago has been open for 129 days (4 months).
💤 Last activity was 86 days ago.

Every ignored PR is a contributor who might not come back. Review time matters. (OCA Aging Report)


Reciprocal Review Request

Hi everyone! I found some test failures on this PR and left detailed feedback above. I am happy to discuss or help debug. In the meantime, if any of you get a chance, I would appreciate a look at my open PR(s):

My open PRs across OCA:

Reviewing each other's work helps the whole community move forward. Thank you!


Environment via OCA Neural Reviewer: Minikube + K8s Job + oca-ci/py3.10-odoo16.0 | Odoo 16.0
Automated review by OCA Neural Reviewer + qwen3-coder:30b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants