Remove special to_location_warehouse search clause
This commit is contained in:
1 parent
ff01fc1814
commit
21e0247eef
2 files changed
+1
-26
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Remove special to_location_warehouse search clause
|
||||
* Remove default from and to location and instead use domain
|
||||
* Update cost_price only from supplier to storage
|
||||
|
||||
|
||||
@@ -343,32 +343,6 @@ class Move(ModelSQL, ModelView):
|
||||
def search_rec_name(self, name, clause):
|
||||
return [('product',) + clause[1:]]
|
||||
|
||||
def search(self, args, offset=0, limit=None, order=None, count=False,
|
||||
query_string=False):
|
||||
location_obj = Pool().get('stock.location')
|
||||
|
||||
args = args[:]
|
||||
def process_args(args):
|
||||
i = 0
|
||||
while i < len(args):
|
||||
#add test for xmlrpc that doesn't handle tuple
|
||||
if (isinstance(args[i], tuple) or \
|
||||
(isinstance(args[i], list) and len(args[i]) > 2 and \
|
||||
args[i][1] in OPERATORS)) and \
|
||||
args[i][0] == 'to_location_warehouse':
|
||||
location_id = False
|
||||
if args[i][2]:
|
||||
location = location_obj.browse(args[i][2])
|
||||
if location.type == 'warehouse':
|
||||
location_id = location.input_location.id
|
||||
args[i] = ('to_location', args[i][1], location_id)
|
||||
elif isinstance(args[i], list):
|
||||
process_args(args[i])
|
||||
i += 1
|
||||
process_args(args)
|
||||
return super(Move, self).search(args, offset=offset, limit=limit,
|
||||
order=order, count=count, query_string=query_string)
|
||||
|
||||
def _update_product_cost_price(self, product_id, quantity, uom, unit_price,
|
||||
currency, company, date):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user