[FIX] stock: fix traceability in detailed operations at creation

- Go to Inventory > Master Data > Products and create a Product with Tracking "By Lot"
- Go to Inventory > Configuration > Operation Types
- Edit Receipts:
  * Activate "Show Detailed Operations"
  * Activate "Create New Lots/Serial Numbers"
  * Deactivate "Use Existing Lots/Serial Numbers"
- Go to Inventory > Overview and open Receipts
- Create a Receipt operation
In the Detailed Operations tab, if a Product tracked by lot is added,
an existing lot can be selected although it is disabled in Operation configuration.
Once saved, the selected lot disappears.
"Lot/Serial Number" column is replaced by "Lot/Serial Number Name" column.
A lot name can be entered manually. (It will create the lot at the validation)
But after validation, the lot associated to the Product is the existing lot
that has been selected during the operation creation, not the one that should
have been created from the lot name entered manually.

opw-2323093

closes odoo/odoo#56448

X-original-commit: 75add3d1496ee64d5278bc4250ac41dc4349d460
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Anh Thao Pham (pta)
2020-08-24 16:44:50 +00:00
parent a3505e72c5
commit dda7e42a57
+1 -1
View File
@@ -437,7 +437,7 @@ class Picking(models.Model):
def _compute_show_lots_text(self):
group_production_lot_enabled = self.user_has_groups('stock.group_production_lot')
for picking in self:
if not picking.move_line_ids:
if not picking.move_line_ids and not picking.picking_type_id.use_create_lots:
picking.show_lots_text = False
elif group_production_lot_enabled and picking.picking_type_id.use_create_lots \
and not picking.picking_type_id.use_existing_lots and picking.state != 'done':