diff options
| author | Arnold Moyaux <arm@odoo.com> | 2018-08-06 14:43:28 +0200 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2018-08-06 15:51:25 +0200 |
| commit | 64a219bd0694c6e7f79692f8d1dfd2201f6125e1 (patch) | |
| tree | 8a53505606d4e86a2ba24af034a3aa516288a510 | |
| parent | c5ffca151160f9d99bec036330def108e4e91e0b (diff) | |
[FIX] stock: multiple orderpoints for a same location
commit 47654e98e0ae0ba91b7972cd113be364b7c9862f 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.
| -rw-r--r-- | addons/stock/models/procurement.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py index ce6e16d58f4..405c4f4c318 100644 --- a/addons/stock/models/procurement.py +++ b/addons/stock/models/procurement.py @@ -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]) |
