Skip to content

[19.0][MIG] project_task_code: Migration to 19.0#1667

Open
Kiplangatdan wants to merge 61 commits intoOCA:19.0from
Kiplangatdan:19.0-mig-project-task-code
Open

[19.0][MIG] project_task_code: Migration to 19.0#1667
Kiplangatdan wants to merge 61 commits intoOCA:19.0from
Kiplangatdan:19.0-mig-project-task-code

Conversation

@Kiplangatdan
Copy link
Copy Markdown
Member

No description provided.

@Kiplangatdan Kiplangatdan changed the title [19.0][MIG] project_task_code [19.0][MIG] project_task_code: Migration to 19.0 Feb 11, 2026
@Kiplangatdan Kiplangatdan force-pushed the 19.0-mig-project-task-code branch from a1cf349 to dab13dd Compare February 11, 2026 15:33
Copy link
Copy Markdown

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

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

Code review and tested on runboat, LGTM! Only one minnor suggestion.

Comment thread project_task_code/__manifest__.py Outdated
@Kiplangatdan Kiplangatdan force-pushed the 19.0-mig-project-task-code branch 2 times, most recently from 166e862 to 76549cb Compare February 18, 2026 08:29
@CristianoMafraJunior
Copy link
Copy Markdown
Member

76549cb @Kiplangatdan The name of this commit should be: [MIG] project_task_code: migrate to 19.0

@Kiplangatdan Kiplangatdan force-pushed the 19.0-mig-project-task-code branch from 76549cb to baeba83 Compare February 18, 2026 15:03
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.

Clean migration with proper hooks. 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). 🤖

2 similar comments
@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). 🤖

@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). 🤖

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.

Good migration overall -- the module correctly adopts Odoo 19.0 patterns (models.Constraint, @api.model_create_multi, _rec_names_search, BaseCommon in tests). A couple of minor observations below.

Observations:

  1. Unused PROJECT_TASK_WRITABLE_FIELDS (models/project_task.py): The set PROJECT_TASK_WRITABLE_FIELDS = {"code"} is defined at module level but never referenced anywhere in this module. If this is intended for portal write access (as seen in some Odoo core patterns), the integration with project's WRITABLE_FIELDS would need to be wired up. Otherwise it is dead code.

  2. .pot file version (i18n/project_task_code.pot): The Project-Id-Version header says Odoo Server 18.0 -- should be 19.0 to match the target branch. This is cosmetic and typically auto-regenerated by oca-gen-addon-readme, so not blocking.

  3. Redundant search filter_domain (views/project_view.xml): The search view overrides the name field's filter_domain to include code in the search. However, _rec_names_search = ["name", "code"] on the model already handles name_search lookups covering both fields. The XML filter_domain is for the search bar in list/kanban views specifically, so both are actually needed for complete coverage -- this is correct as-is.

Already approved in a previous review. These observations are non-blocking.

Review posted via CorporateHub OCA review campaign

Comment thread project_task_code/models/project_task.py Outdated
Comment thread project_task_code/i18n/project_task_code.pot Outdated
gurneyalex and others added 25 commits March 12, 2026 09:34
The overload of project.task::create  in the project_task_code would
mutate the dictionaries passed in the vals_list argument. This is a bad
practice which can have unintended side effects in caller code.

We fix this by creating a new dictionary containing the additional field
value and passing this dictionary in the call to super().create()
Currently, the sequence that generates task codes is only available for the
main company [1], which could cause issues at the moment of the installation
process with another modules in multi-companies cases, for example
project_timesheet_holiday [2] because in the other companies, this line [3]
will return False or "/" and will trigger the UNIQUE constraint. With
this change, the sequence can be used by any company [4] using the False
value in the field company_id.

References:
[1] https://github.com/odoo/odoo/blob/7b6c25e/odoo/addons/base/models/ir_sequence.py#L148
[2] https://github.com/odoo/odoo/blob/7b6c25e/addons/project_timesheet_holidays/models/res_company.py#L14
[3] https://github.com/OCA/project/blob/9d08f2d/project_task_code/models/project_task.py#L29
[4] https://github.com/odoo/odoo/blob/7b6c25e/odoo/addons/base/models/ir_sequence.py#L282
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

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

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

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

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

Translation: project-16.0/project-16.0-project_task_code
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/pt_BR/
Search task by its code in x2m fields.
@Kiplangatdan Kiplangatdan force-pushed the 19.0-mig-project-task-code branch from baeba83 to e3e51af Compare March 12, 2026 06:35
@Kiplangatdan Kiplangatdan force-pushed the 19.0-mig-project-task-code branch from e3e51af to 08fd274 Compare March 12, 2026 06:39
Copy link
Copy Markdown

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Functional ok! just a minor comment.

<field name="inherit_id" ref="project.view_task_search_form" />
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="filter_domain">['|', ('name', 'ilike', self),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe this is not neede if we add the _rec_names_search parameter on the model.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.