-
-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] stock: ensure safe UoM change for done smls
We fix 2 related UoM issues: 1. Fix quant inconsistency from changing the UoM of Done stock.move.lines Steps to reproduce: - Enable "Storage Locations" setting - Create a new "Storable Product" and create a receipt for 1 unit of it - Validate the 1 unit receieved - Open "Detailed Operations" of the move and change the stock.move.line UoM to dozen. Expected result: 13 on hand Actual result: 1 on hand To fix this: - prevent users from editing the UoM after the picking is done (i.e. unless adding a new stock.move.line and not saving). - update the write on done logic so stock.move.line UoM changes are considering and will update the quant correctly (in case of RPC or direct write). 2. Prevent changing UoM of Done stock.move to prevent inconsistent field values within stock.move and confusion for users Steps to reproduce: - Complete a picking (incoming is easiest to see) with a new product (i.e. 0 qty) having 1 unit done. - Unlock picking and add a new stock.move with 1 unit done and save. - Edit the just added stock.move's UoM from Units to Dozen. - Check the quantity on hand / Done qty of stock.move after leaving and returning to form. Expected result: 13 On Hand Actual Result: 2 On Hand and the "Done" qty in the picking is 0.0083 (i.e. 1/12 of a dozen) To fix this: - prevent users from editing the UoM after the picking is done (unless adding a new stock.move and not saving) - if a Done stock.move UoM is uodated, a UserError occurs because there is no straightforward way to ensure the quant is updated correctly since is handled within the move.line (i.e. has no visibility to its move's uom change => changing only UoM and not qty done will result in no quant update) closes odoo#75823 Signed-off-by: Arnold Moyaux <[email protected]>
- Loading branch information
Showing
5 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters