vettloffah / odoo-await

Odoo API client featuring async await.
74 stars 29 forks source link

purchase order #29

Closed metizror closed 2 years ago

metizror commented 2 years ago

how to use order_line item i want create purchase.order with product is this right way to create order ? const partnerId = await odoo.create('purchase.order', { partner_id: 12, dest_address_id: false, currency_id: 2, notes: false, invoice_count: 0, invoice_ids: [], invoice_status: "no", fiscal_position_id: false, payment_term_id: false, "product_id": 6, 'order_line':[(0,false,{ 'name':'abcd', // this must be description of product. 'date_planned':Date.now(), // Planned date need to pass. 'product_id':1, 'product_qty':20.0, 'price_unit':2.0 })] });

vettloffah commented 2 years ago

you need to use the "create" action.

See documentation here: https://github.com/vettloffah/odoo-await/blob/master/README.md#many2many-and-one2many-fields