Odoo Help

Welcome!

This community 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.

0

how to get product_id value in one2many from javascript?

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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