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

Prevent selecting the same value in one2many field in odoo

By
ojomo joseph
on 9/27/16, 9:04 AM 167 views

Am trying to prevent selecting of the same value in one2many field, when the 'select an item' button is clicked .For example when trying to select the same product that has been already selected in sale order.

0

Hi,

Well you need specific development for that. It's not something you could configure.

You need to override write() of the main model and in write() you can iterate on the IDs of o2m field and put a check on the Product if it repeats and raise warning. Write() will be called when you save main form, so you won't be notified while you actually inserting line items. I am not sure onchange of o2m field would help because ID of newly inserted line item is not yet created while you add it, but you can give it onchange(o2m) also try.

Regards,

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

1 follower(s)

Stats

Asked: 9/27/16, 9:04 AM
Seen: 167 times
Last updated: 9/28/16, 4:35 AM