Odoo Help

0

how to get product_id value in one2many from javascript?

By
voathnak lim
on 7/18/13, 1:48 AM 1,205 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"/>
</tree>

and i use this javascript code to get the id

this.dataset.ids[this.dataset.index]

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.

Register

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)

Stats

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