Executing the follow RPC, results in a json object return instead of "true" as expected.
When I hit the button in the GUI, a popup comes up and forces me to confirm the validation.
The json return from the RPC, it is apparent, is the popup definition!
{ "jsonrpc": "2.0", "method":"call", "id":921359310,
"params": { "service":"object", "method":"execute_kw",
"args": [ "mydb", "77", "mypw", "stock.picking", "button_validate", [[27]]] }}
Two questions:
1. Is it possible to execute the stock.picking "button_validate" and skip the popup? (Is there another call that I am overlooking?)
2. If I want to do a stock_immediate_transfer "process" instead, what are the id arguments?
I tried it with move ids, but that did not work.
OK, having tried the following:
{ "jsonrpc": "2.0",
"method":"call",
"id":921359310,
"params": {
"service":"object",
"method":"execute_kw",
"args": [ "mydb", "77", "mypw", "stock.picking", "button_validate", [[29]],
{ "context": {"skip_backorder":true} } ]
}
}
But, I still get back some popup json:
{
"jsonrpc": "2.0",
"id": 921359310,
"result": {
"name": "Immediate Transfer?",
"type": "ir.actions.act_window",
"view_mode": "form",
"res_model": "stock.immediate.transfer",
"views": [
[
1058,
"form"
]
],
"view_id": 1058,
"target": "new",
"context": {
"skip_backorder": true,
"button_validate_picking_ids": [
29
],
"default_show_transfers": false,
"default_pick_ids": [
[
4,
29
]
]
}
}
}
So, at this point I am feeling a little stupid, or at least that I didn't understand the "context" shorthand. This seems to indicate it wants to validate picking_id 29, but just won't do it. Is that correct?
We're running V15 in Odoo.sh, by the way.
The json I posted contains "name": "Immediate Transfer?", which looks like it's generated in code that is protected by 'skip_immediate' not 'skip_backorder'
We'll be trying that next.
When skip_immediate is also added to the context, the call returns:
{
"jsonrpc": "2.0",
"id": 921359310,
"result": true
}
But the stock.picking record does not move inventory or change state.