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)
This commit is contained in:
Ian Wilson committed 2013-01-16 12:24:27 -08:00
1 parent ccd27bbf60
commit d41c525b55
1 file changed
+5 -5
+5 -5
View File
@@ -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)