Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

Hi friends,

I Need to add a new line in one2many field from js without using python. And also I need to edit existing records using js.

odoo version : -13 or 14


Avatar
Buang
Jawaban Terbai

You can use rpc.query for this. In rpc, there are several methods available: create,read,write, search_read, etc.

For Example:

if I need to add sale_order_lines to a sale_order.

var res = rpc.query({
            model: 'sale.order.line',
            method: 'create',
            args: [{
            order_id: orderID,        // ID of the sales order
            product_id: productID,    // ID of the product to add
            product_uom_qty: quantity // Quantity of the product }],
             kwargs: {}
           })

Regards

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Sep 15
5615
1
Sep 23
4086
2
Okt 22
22364
1
Jun 22
7177
3
Apr 20
11519