From 2e0df7594b8e7339a960ef6a5198a67786d911c5 Mon Sep 17 00:00:00 2001 From: "Denis Vermylen (dve)" Date: Thu, 22 Sep 2016 16:15:56 +0200 Subject: [PATCH] [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. --- addons/stock/models/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 831d6f15b68..6d0bdb32e05 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -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):