[FIX] stock: multiple orderpoints for a same location

commit 47654e98e0 modified a defaultdict by an OrderedDict.
When multiple orderpoints use the same location the key is the same and
location_data dict entry is removed for the new one.

This commit only call makedefault when there is not current entry for
the dict.
This commit is contained in:
Arnold Moyaux
2018-08-06 15:51:25 +02:00
parent c5ffca1511
commit 64a219bd06
+2 -1
View File
@@ -339,7 +339,8 @@ class ProcurementGroup(models.Model):
for orderpoint in orderpoints:
key = self._procurement_from_orderpoint_get_grouping_key([orderpoint.id])
location_data[key] = makedefault()
if not location_data.get(key):
location_data[key] = makedefault()
location_data[key]['products'] += orderpoint.product_id
location_data[key]['orderpoints'] += orderpoint
location_data[key]['groups'] = self._procurement_from_orderpoint_get_groups([orderpoint.id])