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

[16.0][FIX] stock_picking_return_restricted_qty: remove _onchange_quantity method #1799

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

ced-adhoc
Copy link
Contributor

Creating this fix to remove the _onchange_quantity method because when changing the quantity on the return wizard to a greater quantity than the original and clicking on the return button, it first validate the _onchange_quantity method and, due to the user error, changes back the quantity to the original one and then it runs the _create_returns method with the original quantity. This causes that if the user made a mistake and wanted to return less quantity than the original one, they cannot correct it since the return is already created.
With this fix, after clicking on the return button, it validates the quantities and when closing the user error popup window it remains on the return wizard allowing to correct the returned quantity.

Copy link

@luc-adhoc luc-adhoc left a comment

Choose a reason for hiding this comment

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

functional review

qty = self.get_returned_restricted_quantity(self.move_id)

if restrict_return_qty and self.quantity > qty:
raise UserError(_("Return more quantities than delivered is not allowed."))
Copy link
Contributor

Choose a reason for hiding this comment

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

@ced-adhoc You remove here a fucntionality. Maybe in order to get user warned before validating the return should be to add an alert on the wizard form (if it is possible) or by other mean.

@rousseldenis rousseldenis added this to the 16.0 milestone Dec 20, 2024
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