Odoo Help


how to get product_id value in one2many from javascript?

Voathnak Lim
on 7/18/13, 1:48 AM 1,491 views

Hello, have a one2many field in BOM. that its xml is:

<tree string="Components" editable="bottom">
                      <field name="product_id" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, name)"/>
                      <field name="product_qty"/>
                      <field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
                      <field name="name" invisible="1"/>
                       <field name="date_start"/>
                       <field name="date_stop"/>

and i use this javascript code to get the id


but the id that i get is not the product_id it is the bom_lines_id . so please help me get the product id from this field. Thanks you.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 7/18/13, 1:48 AM
Seen: 1491 times
Last updated: 3/16/15, 8:10 AM