From f72ac0a5390d01e66521ff9ac84af17da73f0bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 19 Jan 2010 14:12:13 +0100 Subject: [PATCH] Fix test on to_location_warehouse for XML-RPC for issue1380 Tuple in XML-RPC are list --- move.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/move.py b/move.py index ed419412d1..24a115328c 100644 --- a/move.py +++ b/move.py @@ -1,7 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Move" -from trytond.model import ModelView, ModelSQL, fields +from trytond.model import ModelView, ModelSQL, fields, OPERATORS from trytond.backend import TableHandler from decimal import Decimal @@ -388,10 +388,11 @@ class Move(ModelSQL, ModelView): def process_args(args): i = 0 while i < len(args): - if isinstance(args[i], list): - process_args(args[i]) - if isinstance(args[i], tuple) \ - and args[i][0] == 'to_location_warehouse': + #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(cursor, user, @@ -399,6 +400,8 @@ class Move(ModelSQL, ModelView): 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(cursor, user, args, offset=offset,