title: Odoo 8 Python How To assign Many2many Or one2many XMLRPC Create object
body: <p>I need help with XMLRPC , I'm using python , i'm trying to create product variant and i need to assign value to field many2many , here's my code </p>
  
  <pre><code>   idProductLineAttributeLine = 
     models.execute_kw(db,uid,password,'product.attribute.line','create',
     [{'product_tmpl_id':idProduct,'attribute_id':idAttr,'value_ids': (6,0,
     [idValue])}])
  </code></pre>
  
  <p>if i'm assign normal field everythings work fine but when it comes to many2many field or one2many field its show arrow like this</p>
  
  <pre><code>in __dump\nTypeError: cannot marshal &lt;type 'builtin_function_or_method'&gt; objects\n", "message": "cannot marshal &lt;type 'builtin_function_or_method'&gt; objects", "name": "exceptions.TypeError", "arguments": ["cannot marshal &lt;type 'builtin_function_or_method'&gt; objects"]}}}
  </code></pre>
  
  <p>what did i do wrong? please help me :) , thank's in advanced</p>
  
  <p>In the book odoo essential its said i must use this one too assign many2many value or one2many value but still no luck</p>
  
  <pre><code>(0,_ ,{' field': value}): This creates a new record and links it to this one
  (1, id,{' field': value}): This updates values on an already linked record
  (2, id,_): This unlinks and deletes a related record
  (3, id,_): This unlinks but does not delete a related record
  (4, id,_): This links an already existing record
  (5,_,_): This unlinks but does not delete all linked records
  (6,_,[ ids]): This replaces the list of linked records with the provided list
  </code></pre>
  
  <p><strong>updated</strong>
   I manage to solve this problem by adding []  thx to dccdany for pointing this out :), and the product variant added to product </p>
  
  <pre><code> models.execute_kw(db,uid,password,'product.attribute.line','create',   [{'product_tmpl_id':idProduct,'attribute_id':idAttr,'value_ids': (6,0,       [idValue])}])
  </code></pre>
  
  <p>, but the the product variant does not auto generate , i still need to manually refresh the product by editing and saved any idea why?</p>
  
  <p><a href="https://i.stack.imgur.com/QSY6D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QSY6D.png" alt="http://imgur.com/WGLUbQo"></a></p>
  
  <p>as seen in the screenshot there's 4 product variant but the status near top right only said 3 variant did i miss something here??</p>