[FIX] stock: Reformulation of the quantity constraint by the quants #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses:
Situation 1: A quant of a serial product must be able to have more than one unit as long as the sum of all the quants of that serial product and at that location is not greater than 1. That is, a product must be able to return more than once.
Situation 2: At the same time, a serial product should not have more than one unit in a location that is not of the 'Inventory Loss' type.
To ensure that you do not have a duplicate serial product in a location it is necessary that the absolute value of the sum of the quantities of that product in that location is less than 1. This is mainly thought for products that are stored in Units. If a product is stored in 'kilograms' (grams), you could have more than one quant in 'WH/ Stock' if the sum of the quantities is less than 1.
Current behavior before PR:
Situation 1: You can't return a serial product more than once if it went out with different packages because it would end up with a quant in 'WH/Customers' location of -2 units. Check how to reproduce steps at the end of the description.
2023-07-17.12-17-46.mov
Situation 2: You are allowed to have more than one unit of a serial product in 'Stock' location. You can arrive in this situation if packages are different.
2023-07-17.12-01-30.mov
Desired behavior after PR is merged:
Situation 1: You can return a serial product more than once if it went out with different packages. A quant can end up with -2 units in 'WH/Customers' location.
2023-07-17.12-36-17.mov
Situation 2: You are not allowed to have more than one unit of a serial product in 'Stock' location.
2023-07-17.12-08-28.mov
How to reproduce the issue:
Situation 1:
Situate 2:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr