[IMP] stock_quant_package_move_wizard: more accurate source location on picking when all quants have the same location

This commit is contained in:
Alexis de Lattre
2025-06-23 09:29:39 +00:00
parent 0c97c7e1b2
commit 6567d6ad29
5 changed files with 28 additions and 24 deletions

View File

@@ -100,6 +100,11 @@ class StockQuant(models.Model):
"location_dest_id": dest_location.id,
"origin": origin,
}
source_loc_ids = set()
for quant in self:
source_loc_ids.add(quant.location_id.id)
if len(source_loc_ids) == 1:
vals['location_id'] = list(source_loc_ids)[0]
return vals
def move_full_quant_to(self, dest_location, picking_type=False, origin=False):