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

Dynamic Value in selection field

By
Umashankar Subramani
on 12/31/15, 4:28 AM 570 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.............

0

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
896
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile

tibrahim@2p.com.sa

Tarek Mohamed Ibrahim
On 1/3/16, 8:55 PM

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



0
Yogesh
On 1/3/16, 11:39 AM

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.

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

Umashankar Subramani
on 1/3/16, 11:39 PM

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: 12/31/15, 4:28 AM
Seen: 570 times
Last updated: 1/3/16, 8:55 PM