|
25 | 25 |
|
26 | 26 | import com.debortoliwines.odoo.api.OdooXmlRpcProxy.RPCProtocol; |
27 | 27 | import com.debortoliwines.odoo.api.OdooXmlRpcProxy.RPCServices; |
| 28 | +import java.util.Arrays; |
28 | 29 |
|
29 | 30 | /** |
30 | 31 | * * |
@@ -235,12 +236,26 @@ public Object executeCommand(final String objectName, final String commandName, |
235 | 236 | Object[] connectionParams = new Object[]{databaseName, userID, password, objectName, commandName}; |
236 | 237 |
|
237 | 238 | // Combine the connection parameters and command parameters |
| 239 | +// Object[] params; |
| 240 | +// if () |
238 | 241 | Object[] params = new Object[connectionParams.length + (parameters == null ? 0 : parameters.length)]; |
239 | 242 | System.arraycopy(connectionParams, 0, params, 0, connectionParams.length); |
240 | 243 |
|
241 | 244 | if (parameters != null && parameters.length > 0) { |
242 | 245 | System.arraycopy(parameters, 0, params, connectionParams.length, parameters.length); |
243 | 246 | } |
| 247 | + if (this.getServerVersion().getMajor() == 9 && this.context.size() > 0) { |
| 248 | + Integer initial_length = params.length; |
| 249 | + params = Arrays.copyOf(params, initial_length + this.context.size()); |
| 250 | + System.arraycopy(this.context.toString(), 0, params, initial_length, this.context.size()); |
| 251 | + } |
| 252 | + |
| 253 | + //Try to always deal with the context |
| 254 | +// (this.getServerVersion().getMajor() < 10) |
| 255 | +// ? new Object[]{filter, offsetParam, limitParam, orderParam, false, count} |
| 256 | +// : new Object[]{filter, offsetParam, limitParam, orderParam, count}; |
| 257 | +// this.getServerVersion() |
| 258 | +// System.arraycopy(this.getContext(), 0, params, connectionParams.length, parameters.length); |
244 | 259 | return objectClient.execute("execute", params); |
245 | 260 | } |
246 | 261 |
|
|
0 commit comments