Skip to Content
Menu
This question has been flagged
1 Reply
3075 Views

Hi ! I'm on Odoo (v8).

Case:

A user can change the value of a many2one field.

There should be another field, probably many2many, with many2many_cheboxes as widget type, which would be computed, depending on the value of the first field.

For example:

If the user select 'computer' in the first field, the second field will show 'format', 'diagnosis' and 'change screen' for example. Then the user will be able to check which reparation he wants to choose (multi-selection, that explain the checkboxes).

Is it even possible ?

Avatar
Discard
Best Answer

Hi,

Yes it is possible,

first you'll save the services on the 'many2one' field [e.g "computer" ] I think it'll be one2many. So in the computer form you have the list of services e.g 'format', 'diagnosis' and 'change screen' etc ..

In your main form [ where the user chooses the type e.g computer] I think it is better to make a one2many relation with e.g service_line 'just like the sale order' if you need to enter the price or something  ... and you use on_change method to fill this one2many lines with the services ...


I hope it will helps

Avatar
Discard
Author

I have tried something similar, but the checkboxes are selected, and the whole list is then unclickable. That's because I set the fields, instead of filtering them. I would like to use a domain, I think, but I have no idea how to do it in v8 in a computed field.

I think it will be helpful if you past some code ...