-
-
Notifications
You must be signed in to change notification settings - Fork 31
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] repair_stock_dest: New module repair_stock_dest #56
base: 17.0
Are you sure you want to change the base?
Conversation
1dc8179
to
03746a8
Compare
cb50e7c
to
5e739a7
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
5e739a7
to
d15b5f6
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, code review and 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
This PR has the |
repair_stock_dest/models/repair.py
Outdated
def action_repair_done(self): | ||
res = super().action_repair_done() | ||
|
||
for record in self: | ||
record.move_id.location_dest_id = record.product_location_dest_id.id | ||
return res |
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.
@ppyczko This location update seems less than ideal. You are changing the destination location of the repaired product after its completion. If you look at the parent method, the default inheritability of the method that creates the stock move is less than ideal. (And what about the quantities of the product that should be set in the stock.quant
table? My guess would be that this is not updated properly.
I think you have 2 options here:
- Pass a context value in this method which should be detected the create method of the stock move, then prior to creation of the product stock move update the destination location.
- Change the implementation entirely by creating an additional stock move which will transfer the product to a different location after completing the repair. (I believe this will also make the traceability of the product clearer as the repair and the move are split and not done in the same operation.
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.
Thank you for the detailed feedback @PieterPaulussen. I went with option 2, of creating an additional stock move to transfer the repaired product, as it makes sense to have this move split from the repair move itself.
Could you review again please? Thanks!
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.
What do you think about it @LoisRForgeFlow?
d15b5f6
to
662e0da
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.
Isnt this overlapping with https://github.com/OCA/repair/tree/16.0/repair_picking_after_done ?
Hi @LoisRForgeFlow, thank you for your input! I reviewed the module you suggested, and while both solutions aim to transfer the repaired product to another location, they differ in the user process. In repair_picking_after_done, to complete the transfer, the user has to:
By contrast, in repair_stock_dest, our objective was to simplify this workflow by automating the transfer to a pre-defined location once the repair is completed. Additionally, if the user needs to change the destination, this can be done directly within the repair order, and the transfer will be handled automatically, eliminating the need for manual creation and validation. Anyhow, I would appreciate your thoughts on this distinction. If you believe the modules overlap or think any modifications are needed, please let me know, any suggestions are welcome! |
@ppyczko Thanks for the comparison. Do you think it would make sense to make this module an extension of repair_picking_after_done? Another option is to extend with a repair_picking_after_done to decide if the transfer is automatic or not? This way we would have a more unified solution for transfers after repairs. |
Thank you for your suggestion @LoisRForgeFlow! I think it sounds good to adapt this module to extend repair_picking_after_done and incorporate the ability to decide whether the transfer will be automatic or not. I'll start working on the migration to v17 of the repair_picking_after_done module and these changes. |
This module enhances the repair process by adding the ability to transfer a repaired product to a specified destination location upon completion of the repair. It introduces a Product Destination Location field in the repair order, which defines where the repaired product will be transferred. The default value for this field is set from the Default Product Destination Location field of the associated Operation Type.
Upon the completion of a repair order, an additional stock move is automatically created to transfer the repaired product to the specified destination location.
cc https://github.com/APSL 160548
@miquelalzanillas @lbarry-apsl @mpascuall @peluko00 @javierobcn @BernatObrador please review