Skip to content

[15.0][MIG] sale project service tracking copy tasks #1188

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

Merged

Conversation

EmilioPascual
Copy link

This module add the possibility to create task in an existing project from the sales order through setting the product with a project template with the desired task.

@moduon MT-1028

@Shide, @rafaelbn please review 😊

EmilioPascual and others added 4 commits November 6, 2023 13:37
This module add the possibility to create task in an existing project from the sales order through setting the product with a project template with the desired task.

@moduon MT-1028

Co-authored-by: Eduardo de Miguel <[email protected]>
@rafaelbn rafaelbn added this to the 15.0 milestone Nov 6, 2023
@rafaelbn rafaelbn requested a review from Shide November 6, 2023 16:39
Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

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

👍🏼

@EmilioPascual EmilioPascual force-pushed the 15.0-mig-sale_project_service_tracking_copy_tasks branch 2 times, most recently from a245886 to 9b54b8d Compare November 7, 2023 11:45
Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

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

Looks really good.

A few suggestions, but only a few are blocking.

pp_model = self.env["project.project"]
created_projects = pp_model.browse()
for order in self:
projects = order.mapped("order_line.product_id.project_template_id")
Copy link
Member

Choose a reason for hiding this comment

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

question: shouldn't you filter the products by their service tracking?

Copy link
Author

Choose a reason for hiding this comment

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

Filtered in _timesheet_service_generation from sale_order_line before the method is called

<xpath expr="//field[@name='project_template_id']" position="attributes">
<attribute
name="attrs"
>{'invisible': [('service_tracking', 'not in', ['task_in_project', 'project_only', 'copy_tasks_in_project'])], 'required': [('service_tracking', 'in', ['copy_tasks_in_project'])]}</attribute>
Copy link
Member

Choose a reason for hiding this comment

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

thought(non-blocking): https://github.com/OCA/server-tools/tree/16.0/base_view_inheritance_extension could let you add this in a more resilient fashion.

@EmilioPascual EmilioPascual force-pushed the 15.0-mig-sale_project_service_tracking_copy_tasks branch from 9b54b8d to c93b7c9 Compare November 8, 2023 08:19
@EmilioPascual EmilioPascual requested a review from yajo November 8, 2023 09:56
@EmilioPascual EmilioPascual force-pushed the 15.0-mig-sale_project_service_tracking_copy_tasks branch from 1807a0c to 0dab46e Compare November 8, 2023 10:07
Copy link

@Shide Shide left a comment

Choose a reason for hiding this comment

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

Code LGTM

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

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

Just one missing detail to go.

"summary": "Copy tasks into sale order's project",
"version": "15.0.1.0.0",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["shide", "EmilioPascual"],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"maintainers": ["shide", "EmilioPascual"],
"maintainers": ["rafaelbn", "shide", "EmilioPascual"],

@yajo
Copy link
Member

yajo commented Dec 14, 2023

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-1188-by-yajo-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 1e7abc1 into OCA:15.0 Dec 14, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 7647319. Thanks a lot for contributing to OCA. ❤️

@Shide Shide deleted the 15.0-mig-sale_project_service_tracking_copy_tasks branch December 15, 2023 06:57
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.

5 participants