Skip to Content
Menu
This question has been flagged
3 Replies
2435 Views

Hello!


I'm a newbie with odoo. Can someone help me and tell how can i create dynamic selection fields in demo products? I need to add two selection fields: one for manufacturer (For example: LG, Samsung) and another selection field for the model that would depend from the selected manufacturer. For example, if we selected LG, then in models field we'll see only models for LG, and if Samsung is selected, then only models for samsung we can select in models field.


I've already read the official documentation, but still have no idea how to do it :\


Thanks for any help.

Avatar
Discard
Best Answer

Hi,

Please check the the blog to know more about dynamic fields in Odoo.

 

Avatar
Discard
Best Answer

Hey, 

you'll need to add two masters(new models), one will correspond to the manufacturer and the other to the manufacturer's model. In the manufacturer's model master, there will be a field corresponding to the manufacture. 

Now after adding the masters, you'll add two fields in the product view. One for "manufacturer" and another for "model". When the user selects the "manufacturer", trigger a method that will apply a domain for the "model" dropdown. It's called applying dynamic domain. 

This should work.

Thanks

Avatar
Discard
Author Best Answer

Thank you for your answer, but I still have no idea how to make this fields  in products.

I think that blog for professionals...

What is the file wizard.py? Where should I create or edit it? or is it necessary to create a new model for this? Where should I place the get_possible_field_types method? In my new module in models.py? The same with onchange_field_type method...
I can't find any tutorials for beginners, there is only information for professionals.  For a example for django, I can find a huge amount of information and tutorial videos for beginners, and absolutely nothing for odoo.

Avatar
Discard
Related Posts Replies Views Activity
4
Dec 23
20429
5
Jul 24
13729
1
Jun 22
25194
9
May 22
50520
0
Jul 20
1878