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

[17.0][ADD] mrp_repair_order: New module mrp_repair_order #1346

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

peluko00
Copy link
Contributor

@peluko00 peluko00 commented Sep 1, 2024

New module
The mrp_repair_order module allow to create a repair order from the manufacturing order when the manufacturing order is done.
You can access from the boths models to other order.

cc https://github.com/APSL 159985
@miquelalzanillas @lbarry-apsl @javierobcn @mpascuall @BernatObrador @ppyczko please review

@peluko00 peluko00 force-pushed the 17.0-add-mrp_repair_order branch 3 times, most recently from 47f1de0 to 723e7bd Compare September 2, 2024 08:14
Copy link

@BernatObrador BernatObrador left a comment

Choose a reason for hiding this comment

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

LGTM, tested in runboat and works as intended.

Copy link
Contributor

@ppyczko ppyczko left a comment

Choose a reason for hiding this comment

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

LGTM, tested in runboat

Copy link

@mpascuall mpascuall left a comment

Choose a reason for hiding this comment

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

LGTM, tested in runboat

res = super().create(vals_list)
self.env["mrp.production"].browse(
self.env.context["default_mrp_id"]
).repair_id = res.id
Copy link

Choose a reason for hiding this comment

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

This will fail if more then one repair order is created, res will contain multiple records


def _compute_mrp_production_count(self):
self.mrp_count = len(
self.env["mrp.production"].search([("repair_id", "=", self.id)])
Copy link

Choose a reason for hiding this comment

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

Compute methods expect a record set. You need to loop through self.
I notice you are using a lot of search for the is of the repair order on the manufacturer order. Maybe would be a good idea to create a one2many for production orders and match on the field repair_id . Let Odoo have the records available to you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the anotations, i make a one2many for production orders.
Can you review again please

@peluko00
Copy link
Contributor Author

Hi @gbrito, can you review again please. Thanks!

@peluko00
Copy link
Contributor Author

Hi @pedrobaeza, could you review please when you have a moment? Thanks!

@pedrobaeza pedrobaeza added this to the 17.0 milestone Oct 25, 2024
@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-1346-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 4d0c3b0 into OCA:17.0 Oct 25, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

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.

7 participants