Walid f949af22ce [FIX] stock: use existing lots when importing lots
Steps to reproduce:
1. Install Inventory app.
2. Enable "Storage Locations" in Inventory settings.
3. Create a new product known as "X". Set it's tracking to "By Unique Serial Number".
4. In Inventory -> Configuration -> Operation Types -> Receipts, set "Use Existing Ones" to true.
5. Create a new Receipt, add a new line of product X.
6. In the "Details" page of the X line, click "Import Serials/Lots".
7. Enter at least two lines of two serial numbers and import.

Bug:
Notice that the "Lot/Serial Number" column on each row are blank.
This is happening because the view used for stock move lines here will
display either the lot_id field of a sml, or the lot_name field,
based on varying conditions. In this case, setting "Use Existing Ones"
to true will cause the lot_id field to be displayed (and the lot_name
field to be invisible). When importing lots, only the lot_name  is set
with the user's input but the lot_id is left blank. So because lot_id
is empty, the column is empty. But this works as expected
when "Use Existing Ones" is false because it displays the correctly
set lot_name. When the receipt is validated,
the lot is created and lot_id for each of the smls is set,
so now it displays properly.

Fix:
when "Use Existing Ones" is set first check if lot exists and set it in
that case, otherwise create and set a new lot at that moment

opw-3498812

closes odoo/odoo#140400

X-original-commit: c5a35a1c2a7e16adbd3f2b1e37509003bcfac957
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-10-31 14:40:57 +00:00
2023-10-27 08:36:16 +00:00
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

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

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%