Skip to Content
Menu
This question has been flagged
1 Reply
3941 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.

 

 

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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 ?

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.

Author

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