Odoo Help


Add column from Product to Sales.Order.Line and use it to add item line

Mahmoud Korayem
on 11/24/14, 4:06 AM 900 views

Dear All,

I added a custom field to the product -one2many- called Genuine Numbers ( so that each product has multiple part numbers)

I added this column to the sales.order.line

How can I use this column drop-down to enter itemline in the same way the normal system uses the name/internal reference

All that in the add an item inline mode, not the pop-up window mode.






| 5 3 6
Jakarta, Indonesia
On 11/24/14, 4:13 AM

Mahmoud, if you want to search product based on the Genuine Numbers, which is a column in product.product, you want to look into inhering name_search view.  However, I see that you added that column in sale.order.line (I presume it is also editable), then maybe you can make the product to change when the Genuine Numbers is changed, and then make the product field to be readonly if Genuine Number is filled in.

Sorry If my question was not clear about where I added the column The custom field "Genuine Numbers" added as one2many in the product.product and the Genuine Numbers are not Unique. and then I need to add this field to be on the sales.order.line and use it to "Add an item" same as using the name/internal reference. All in the inline-mode not "Pop-UP window" mode Here is the flow I am considering: Go to sales order --> Create --> Add an Item --> Go to "Genuine Numbers" column --> Start entering using the part number --> choose one --> System adds new item line and grabbed related data and put it in all other columns including the Name/Internal Reference, unit of measure, unit price, etc ... Is that possible ?

Mahmoud Korayem
on 11/24/14, 4:51 AM

I'm still not sure what you mean by "same as using the name/internal reference". When you Add an Item, the view will add a record automatically (saved when you click the main Save button). If you need to add a many2one field of Genuine Numbers in the sale.order.line and its related view, then you need to create the field in sale.order.line and display it view, then you enter value in the Genuine Numbers column. If you want to populate other fields based on the value of Genuine Numbers selected, you can use the on_change mechanism. However, as you say, Genuine Numbers is not unique, so you need to pay special care when choosing the values to populate the other fields because searching product.product by Genuine Numbers may return more than one records.

on 11/24/14, 5:17 AM

First: "Same as using the name/internal reference", in the sense of that it is a drop-down menu where the system start listing the items similar to what I am entering in the box. Second: Yes it should get multiple results with the same genuine#, My question is: Can I see the results in a List such as with "name" and choose one of them, then it will populate the item line with data of this specific product.

Mahmoud Korayem
on 11/24/14, 7:05 AM

Mahmoud I've explained on how you can achieve that in my previous comment. Add the field in sale.order.line, display it in the view, implement on_change mechanism on that field. Since there can be more than one Genuine Number per product.product, you cannot list it in the Product field.

on 11/25/14, 12:59 AM

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

1 follower(s)


Asked: 11/24/14, 4:06 AM
Seen: 900 times
Last updated: 3/16/15, 8:10 AM