Skip to Content
Menu
This question has been flagged
1 Reply
4689 Views

write method , for Update , can any one explain these to me ??!

code :-

$models->execute_kw($db, $uid, $password,'sale.order', 'write',array(array(0), array('state'=>'sale')));

Avatar
Discard
Best Answer

$models->execute_kw($db, $uid, $password,'sale.order', 'write',array(array(0), array('state'=>'sale')));

$url = <insert server URL>;
$db = <insert database name>;
$username = "admin";
$password = <insert password for your admin user (default: admin)>;


'sale.order' - module that to perform action (object of module )

'write' - write method (updation)

array(array(ids), - passing record id to update

array('state'=>'sale' - updating state field to 'sale'



$models->execute_kw($db, $uid, $password, 'res.partner', 'write',
    array(array($id), array('name'=>"Newer partner")));
// get record name after having changed it
$models->execute_kw($db, $uid, $password,
    'res.partner', 'name_get', array(array($id)));

Thank you , 

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 18
3122
3
Aug 17
4781
1
Mar 15
6188
2
Mar 15
9150
0
May 23
1099