1、优化货位

This commit is contained in:
yuxianghui
2024-05-30 17:26:28 +08:00
parent 1d4aaa40cd
commit 7d6fb4f0e3
2 changed files with 18 additions and 11 deletions

View File

@@ -826,15 +826,20 @@ class Sf_stock_move_line(models.Model):
obj = self.env['sf.shelf.location'].search([('name', '=',
self.destination_location_id.name)])
if record.lot_id:
shelf_location_obj = self.env['sf.shelf.location'].search(
[('product_sn_id', '=', record.lot_id.id)])
if shelf_location_obj:
shelf_location_obj.product_sn_id = False
if obj:
obj.product_sn_id = record.lot_id.id
else:
if obj:
obj.product_sn_id = record.lot_id.id
if record.product_id.tracking == 'serial':
shelf_location_obj = self.env['sf.shelf.location'].search(
[('product_sn_id', '=', record.lot_id.id)])
if shelf_location_obj:
shelf_location_obj.product_sn_id = False
if obj:
obj.product_sn_id = record.lot_id.id
else:
if obj:
obj.product_sn_id = record.lot_id.id
elif record.product_id.tracking == 'lot':
obj.product_sn_ids |= record.lot_id
if not obj.product_id:
obj.product_id = record.product_id.id
else:
if obj:
obj.product_id = record.product_id.id