From 25dac7424e2f8f3d5d1ff1a0cc45da1de314ce76 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 (transplanted from 5522087017922d66c30097f6000a484559395abe) --- move.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/move.py b/move.py index 5c8a9c078c..0e51b5daeb 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.osv import fields, OSV +from trytond.osv import fields, OSV, OPERATORS from decimal import Decimal import datetime @@ -305,10 +305,11 @@ class Move(OSV): 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, @@ -316,6 +317,8 @@ class Move(OSV): 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,