6c853953eb626993bc6280a5d146edf7a1fdeb3d
When creating a receipt with products tracked by lot or serial number, empty move lines are automatically created when the receipt is validated Steps to reproduce: 1. Install Inventory 2. Go to Inventory > Configuration > Warehouse Management > Operations Types 3. Open Receipts and enable 'Show Detailed Operations' and 'Pre-fill Detailed Operations' 4. Go to Overview > Receipts and create a new receipt, in Detailed Operations add product 'Cable Management Box' with any serial number and a quantity of 1 5. Validate the receipt, a new line is added in Detailed Operations with quantity 0 Solution: When we create a stock move line and we need to create a lot, we create the lot with the context key `do_not_unreserve` Problem: When we create and write the lot on stock move lines, we detect that the `product_uom_qty` is not set. Because we are in an immediate transfer, we will try and assign it the `quantity_done`. https://github.com/odoo/odoo/blob/7fec535f3d84d15899aea5e61b51947f260d9697/addons/stock/models/stock_move_line.py#L467-L469 By writing the `product_uom_qty` on the stock move, we will try to unreserve and reserve again the stock move (if `do_not_unreserve` is not in the context) https://github.com/odoo/odoo/blob/ba3bb9b701a382c4052ddb57392baeee32625937/addons/stock/models/stock_move.py#L569-L576 This will then create the undesired empty move lines (that are supposed to be the 'Pre-filled Detailed Operations') in _action_assign https://github.com/odoo/odoo/blob/3e8a45fce0af0aa5792f0aea978d4ab78ab50a40/addons/stock/models/stock_move.py#L1586 opw-2897875 closes odoo/odoo#95983 Signed-off-by: Tiffany Chang <tic@odoo.com>
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%