-
-
Notifications
You must be signed in to change notification settings - Fork 729
[16.0][FIX] stock_picking_return_restricted_qty: remove _onchange_quantity method #1799
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
base: 16.0
Are you sure you want to change the base?
Conversation
12ac81a to
8398544
Compare
luc-adhoc
left a comment
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 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.")) |
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.
@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.
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.
@rousseldenis Hi! I'm taking up this task based on you suggestion. I replaced the UserError with a warning in the onchange quantity method, and it seems to work as expected. Could you please review it again and let me know your thoughts? Thanks!
|
@rousseldenis What's the point to put the UserError on an onchange_quantity method if either way the quantity restriction will be validated when clicking on the return button? It looks redundant. It makes any difference? Sorry to ask! I was just wondering because it doesn't make too much sense to me. |
…th warning in `_onchange_quantity`
8398544 to
4eee2cb
Compare
|
@rousseldenis Hi! I'm taking up this task based on you suggestion. I replaced the UserError with a warning in the onchange quantity method, and it seems to work as expected. Could you please review it again and let me know your thoughts? Thanks! |
florenciafrigieri2
left a comment
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.
Test working ok.
When the restriction is set in the operation type, Odoo is not allowing to return bigger quantities. If you have a mistake, it is possible to correct it.
|
Hi @rousseldenis could you please check this fix? Thanks in advance! |
|
Hi @rousseldenis could you please check this? thanks! |
|
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. |
|
The idea to raise a |
This fix replaces the UserError in _onchange_quantity with a warning message. Now, users receive a non-blocking notification when attempting to return more products that delivered, but allows them to modify the quantity before proceeding.
The restriction logic remains unchanged for _create_returns, ensuring hard enforcement at the validation stage.