From d41c525b55138b910bc8745cfcb6450e1c167a04 Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Wed, 16 Jan 2013 12:24:27 -0800 Subject: [PATCH] Fix logic error in _set_warehouse_parent method. The `if to_update:` conditional should be inside the for loop of the method _set_warehouse_parent on the Location model. Clear the set after write. issue2951 review629004 (transplanted from 1b315604e53eed2c10fdab06fd7e78f81e35aad5) --- location.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/location.py b/location.py index e05579676f..4d1198c30b 100644 --- a/location.py +++ b/location.py @@ -205,11 +205,11 @@ class Location(ModelSQL, ModelView): location_ids.add(location.output_location.id) if not location.storage_location.parent: location_ids.add(location.storage_location.id) - location_ids = list(location_ids) - if location_ids: - self.write(location_ids, { - 'parent': location.id, - }) + if location_ids: + self.write(list(location_ids), { + 'parent': location.id, + }) + location_ids.clear() def create(self, vals): res = super(Location, self).create(vals)