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 compute the list of the records a user can check ?

By
PY
on 3/19/15, 9:38 AM 335 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 ?

0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 3/19/15, 10:13 AM

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

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.

PY
on 3/19/15, 10:17 AM

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

Ahmed M.Elmubarak
on 3/20/15, 3:17 AM

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: 3/19/15, 9:38 AM
Seen: 335 times
Last updated: 3/19/15, 10:13 AM