Skip to Content
Menu
This question has been flagged
4 Replies
7693 Views

Hi,

   I need a selection field with dynamic value based on another field,

My scenario is,

  1)Need to select Discount range with min and max value(many2one field)

  2)In the selection field dropdown i need only the selected range of values 

Reference:

https://www.odoo.com/es_ES/forum/help-1/question/how-to-create-dropdown-list-in-a-custom-module-and-the-values-for-dropdownlist-fetches-from-database-82670


Please give me some suggestion.............

Avatar
Discard
Best Answer

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Avatar
Discard
Best Answer

If he used in the xml view the widget

widget="selection"

then the field would appear same as a selection field even if it comes from a table or a collected items via a function field, and the user then can use domains to change values dynamically



Avatar
Discard
Best Answer

Hi , 

You can not create dynamic selection field because values are loaded at form load and can`t be changed but you can create many2one (with create=False) field and use domain to change values dynamically.

Avatar
Discard
Author

Thanks Yogesh i got that in many2one field, by using name_get function