-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
[15.0][ADD] stock_picking_auto_revert #1491
base: 15.0
Are you sure you want to change the base?
[15.0][ADD] stock_picking_auto_revert #1491
Conversation
cd043c6
to
d986370
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
d986370
to
d8c959b
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.
Code review. Seems great!
# Restrictions before remove quants | ||
if self.returned_move_ids: | ||
raise exceptions.UserError( | ||
_("Action not allowed. Move splited / with returned moves.") |
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.
_("Action not allowed. Move splited / with returned moves.") | |
_("You cannot revert this stock picking. Move splited / with returned moves.") |
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.
Suggestion applied.
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.
functional and code review 👍🏿
I'm not sure if it would be useful to add the reference of the original transfer on the Source Document for the newly created, just so the user has some more traceability on what has happened.
d8c959b
to
861c733
Compare
Thanks @GuillemCForgeFlow I added the original picking name between brackets, like this: |
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! thanks for adding the suggestion 👍🏿
861c733
to
24343d2
Compare
24343d2
to
f122697
Compare
@AaronHForgeFlow Maybe testing exceptions could be great |
f122697
to
05ddb6c
Compare
@rousseldenis tests added :) |
A module that passed several versions :-) |
move._check_restrictions() | ||
|
||
def action_revert_recreate(self): | ||
self.ensure_one() |
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.
And one more question.
Should'nt it be more interesting to do a wizard for that flow ?
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.
Perhaps. I did it this way because the users just want less clicks as possible. I prefer not to change it, if not necessary.
05ddb6c
to
02b3ccb
Compare
"You cannot revert this stock picking. Its stock moves are linked to " | ||
"other moves. Origin pickings: {origin_pickings}. " | ||
"Destination pickings: {destination_pickings}." | ||
).format( |
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.
Ooops, don't use format()
but use translation function arguments.
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.
Yes, sorry for this. It is now fixed.
02b3ccb
to
78a511a
Compare
Module to correct mistakes in pickings the fast way. Instead of cancel this module will create a return and then will recreate the issued picking.
Based on #593 Originally it was discarded because of the stock_cancel module.
Similar approach Odoo uses for correcting mistakes in invoices. that is, do a reverse and recreate the original invoice in draft state so the user can edit it.
cc @ForgeFlow
This PR Replaces: OCA/stock-logistics-warehouse#1918