[FIX] stock: fix domain if no locations

in _get_domain_locations_new

if no locations the domain gets extended by nothing so we have a domain ending
in '&', '!']. This method gets called by opening the Products app, so it was
possible you couldn't open it due to this error.
This commit is contained in:
Denis Vermylen (dve)
2016-09-22 16:15:56 +02:00
parent 6854887ade
commit 2e0df7594b
+2 -2
View File
@@ -214,8 +214,8 @@ class Product(models.Model):
dest_loc_domain = dest_loc_domain + [('location_dest_id', operator, [location.id for location in other_locations])]
return (
domain + loc_domain,
domain + ['&'] + dest_loc_domain + ['!'] + loc_domain,
domain + ['&'] + loc_domain + ['!'] + dest_loc_domain
domain + dest_loc_domain + ['!'] + loc_domain if loc_domain else domain + dest_loc_domain,
domain + loc_domain + ['!'] + dest_loc_domain if dest_loc_domain else domain + loc_domain
)
def _search_virtual_available(self, operator, value):