I'm writing a PHP script using Odoo External API and I've got a model to fill and one of the field I need to create is a one2many.
So as I've seen in documentation (https://doc.odoo.com/6.0/developer/2_5_Objects_Fields_Methods/methods/#osv.osv.osv.write), I tried to give a list of tuplet :
$variable= [0,0,['product_id',1, 'product_uom_qty',35.00]];The error message :
$models->execute_kw($db, $uid, $password, 'stock.picking', 'write', array($id)
array('location_id'=>8, 'name' => 'TEST1', 'move_ids_without_package =>$variable));
TypeError: unhashable type: 'list'
I've also tried with an array :
$variable = array(0 => 0,1 => 0, 2 => array('product_id' =>1, 'product_uom_qty' => 35.00));$models->execute_kw($db, $uid, $password, 'stock.picking', 'write', array($id)
array('location_id'=>8, 'name' => 'TEST1', 'move_ids_without_package=>$variable));
The error message :
TypeError: unhashable type: 'dict'