-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
Conversation
47f1de0
to
723e7bd
Compare
There was a problem hiding this 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.
There was a problem hiding this 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
There was a problem hiding this 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
mrp_repair_order/models/repair.py
Outdated
res = super().create(vals_list) | ||
self.env["mrp.production"].browse( | ||
self.env.context["default_mrp_id"] | ||
).repair_id = res.id |
There was a problem hiding this comment.
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
mrp_repair_order/models/repair.py
Outdated
|
||
def _compute_mrp_production_count(self): | ||
self.mrp_count = len( | ||
self.env["mrp.production"].search([("repair_id", "=", self.id)]) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
723e7bd
to
4304577
Compare
Hi @gbrito, can you review again please. Thanks! |
Hi @pedrobaeza, could you review please when you have a moment? Thanks! |
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at a87efdf. Thanks a lot for contributing to OCA. ❤️ |
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