Skip to content

[19.0][MIG] project_template: Migration to 19.0#1617

Open
Vang-NguyenPhu wants to merge 49 commits intoOCA:19.0from
komit-consulting:19.0-mig-project_template
Open

[19.0][MIG] project_template: Migration to 19.0#1617
Vang-NguyenPhu wants to merge 49 commits intoOCA:19.0from
komit-consulting:19.0-mig-project_template

Conversation

@Vang-NguyenPhu
Copy link
Copy Markdown

No description provided.

patrickrwilson and others added 5 commits December 5, 2025 16:27
Adding new Project Template Module

[FIX] PEP8 Errors

Revert "[FIX] PEP8 Errors"

This reverts commit 90f9cd9.

[FIX] Fixed PEP8 Formatting

First upload tests showed some lint issues which this commit has the fixes for.

[FIX] Fixed LINT Issue

Removed unreachable code that was not needed.

[FIX] RunBot Warning

Fixed runbot warning about @Class to hasclass

[UPD] Suggested Changes

Updated based on suggested changes on other submitted modules.

[UPD] Manifest and Readme

Updated Manifest and Readme based on comments on other module pr's.

[UPD] Suggested Changes

Updated code based on suggested code changes from reviewer.

[FIX] Creation Error

Fixed create project error when creating project via configuration/projects menu

[UPD] Menu and Bool Change

Removed Template Menu (Filter option still there) and moved Bool up below name. (From reviewer suggestions)

[UPD] Kanban Menu

Removed button, added link to kanban menu. Start of tests

[UPD] Remove project_milestone code

Removed the project_milestone code and will create a separate module for that purpose.
@Vang-NguyenPhu Vang-NguyenPhu mentioned this pull request Dec 5, 2025
41 tasks
@leemannd
Copy link
Copy Markdown
Contributor

/ocabot migration project_template

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Dec 11, 2025
Copy link
Copy Markdown

@hieulucky111 hieulucky111 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
Copy Markdown

@huan-tq huan-tq 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
Copy Markdown

@Quan-nhm Quan-nhm left a comment

Choose a reason for hiding this comment

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

Functional Test and Code review LGTM!

@OCA-git-bot
Copy link
Copy Markdown
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). 🤖

@leemannd
Copy link
Copy Markdown
Contributor

leemannd commented Jan 9, 2026

Hello @Vang-NguyenPhu could you quickly take the time to reduce a bit the administrative commits? https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate

Yvesldff and others added 23 commits February 11, 2026 09:50
Since in  original odoo `15.0` version project subtasks
has been deleted so changes also done in this module.
We don't need project subtasks anymore because odoo don't have it.
Currently translated at 100.0% (10 of 10 strings)

Translation: project-16.0/project-16.0-project_template
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_template/de/
Currently translated at 100.0% (7 of 7 strings)

Translation: project-16.0/project-16.0-project_template
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_template/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-16.0/project-16.0-project_template
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_template/
Previously, if multiple tasks in a template project had the same name,
their end_date-values were not copied properly.

Co-authored-by: Stefan Rijnhart <stefan@opener.amsterdam>
* Change the way to copy end dates to tasks due to api change to _map_tasks_default_values which now longer gets passed the task
* Refactor tests to use setUpClass (finally)
* Update overwritten action context with upstream changes
* Remove originally unmodified (but now outdated) fields from overwritten action
* Update kanban element selector
@Vang-NguyenPhu Vang-NguyenPhu force-pushed the 19.0-mig-project_template branch from 29ba6ab to 6aecfce Compare February 11, 2026 02:50
@Vang-NguyenPhu
Copy link
Copy Markdown
Author

Hello @Vang-NguyenPhu could you quickly take the time to reduce a bit the administrative commits? https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate

All good now.

Copy link
Copy Markdown
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

Thanks for the migration work.

The main issue here is that Odoo 19.0 natively includes comprehensive project template support -- is_template field, action_create_from_template(), action_toggle_project_template_mode(), template ribbon, dedicated template views (form/list/kanban), and template filters in search. The native open_view_project_all action already uses domain=[("is_template", "=", False)] to exclude templates from the project list.

This module as-is conflicts with the native implementation in several ways:

  1. Redundant is_template field: Odoo 19.0 already defines is_template = fields.Boolean(copy=False) on project.project. Re-declaring it in this module is harmless but pointless.

  2. Conflicting action window override: The module overrides project.open_view_project_all to set search_default_projects: True, but the native action already uses a hard domain=[("is_template", "=", False)]. This override actually removes that domain filter and replaces it with a weaker search default that users can deselect, which would then show templates mixed in with projects. This is a regression from the native behavior.

  3. Simpler create_project_from_template vs native action_create_from_template: The native method handles date shifting, field blacklisting, role-to-user mapping, and proper copy context. This module's method bypasses all of that.

  4. on_change_is_template name mangling: The native 19.0 doesn't append "(TEMPLATE)" to the project name -- it uses a ribbon widget instead.

Given that Odoo 19.0 has native template support, this module either needs to be:

  • Deprecated/removed with a note that functionality is now native, or
  • Significantly reworked to only add value on top of the native implementation

The task date_end preservation via copy_data/update_date_end overrides might still add value, but the rest conflicts with or duplicates native functionality.

Minor: license header mismatch in __init__.py and __manifest__.py (copyright header says LGPLv3.0, manifest license field says AGPL-3).

class Project(models.Model):
_inherit = "project.project"

is_template = fields.Boolean(copy=False)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This field is already defined natively in Odoo 19.0 project.project model (is_template = fields.Boolean(copy=False, export_string_translation=False)). Re-declaring it here is redundant.

is_template = fields.Boolean(copy=False)

# CREATE A PROJECT FROM A TEMPLATE AND OPEN THE NEWLY CREATED PROJECT
def create_project_from_template(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Odoo 19.0 provides action_create_from_template() natively, which handles date shifting, field blacklisting, role-to-user mapping, and uses proper copy_from_template context. This simpler method bypasses all of that and produces inconsistent UX.

)

# OPEN THE NEWLY CREATED PROJECT FORM
return {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

view_type is deprecated/removed in recent Odoo versions. This key is ignored in 19.0.

<separator />
</filter>
</field>
</record>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This overrides the native open_view_project_all and removes the domain [("is_template", "=", False)] that Odoo 19.0 sets natively. The native action filters templates via domain; this override replaces that with a search default, which is weaker (users can deselect it). This is a functional regression.

@@ -0,0 +1,3 @@
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

License header says LGPLv3.0 but the manifest declares AGPL-3. Should be consistent.

@stferraro
Copy link
Copy Markdown

Is it necessary if this functionality already exists in Odoo 19?

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.