yezyilomo / odoo-rest-api

Module which expose Odoo as a REST API
MIT License
208 stars 167 forks source link

How to do many2many in creation? #15

Closed chris-lsn closed 5 years ago

chris-lsn commented 5 years ago
const product_data_template = {
            ...
            route_ids: {
                push:  [1,2], // Not working
            }
            route_ids: [6,0, [1, 2]] //Not working 
 }

I have try the method as put request and the method from official doc (https://www.odoo.com/documentation/8.0/reference/orm.html#openerp.models.Model.write) for many2many field but it seems not working.

How can I achieve this goal? Thanks

chris-lsn commented 5 years ago

I have finally solved this problem by adding additional square brackets like route_ids: [[6,0, [1, 2]]].