Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] project_task_code: Migration to 17.0 #1355

Open
wants to merge 68 commits into
base: 17.0
Choose a base branch
from

Conversation

nedaszilinskas
Copy link

No description provided.

oihane and others added 30 commits October 22, 2024 18:55
OCA Transbot updated translations from Transifex

[MIG] project_task_code: Migrate to 10.0

Edit init and XML

Add env

Change task_ids to tasks

Change to @api.multi before def copy
Relational fields and the task notification email inform the task code
- adapted view (label needs a `for` attribute, use span for same result)
- use the `model_create_multi` decorator on the create override for
future-proofiness
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Currently translated at 100.0% (3 of 3 strings)

Translation: project-12.0/project-12.0-project_task_code
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_task_code/gl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-13.0/project-13.0-project_task_code
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_task_code/
gurneyalex and others added 24 commits October 22, 2024 18:55
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.
Copy link

@anikeenko-viktor anikeenko-viktor 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

@mtnarjan mtnarjan left a comment

Choose a reason for hiding this comment

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

Looks good!

@n17
Copy link

n17 commented Oct 25, 2024

Looks good to me!

</xpath>
<field name="name" position="before">
<field name="code" />
</field>
Copy link

@coleste coleste Nov 22, 2024

Choose a reason for hiding this comment

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

This revert is weird. I don't think it works.
16.0 has a t-if= / t-else=, same as 17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.