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 create Dropdown list in a custom module and the values for dropdownlist fetches from database?

By
yogesh
on 3/24/15, 6:49 AM 1,733 views

Hello every one,

I created the custom module and i want to add the dropdown list and values for that dropdownlist fetches from the particular field in the database.

kindly give some ideas.

Thanks for the valuable answer.
How to define this field in the XML file.
Should we use any widget?



On Tue, Mar 24, 2015 at 5:09 PM, Emipro Technologies Pvt. Ltd. <erp@emiprotechnologies.com> wrote:

A new answer for How to create Dropdown list in a custom module and the values for dropdownlist fetches from database? has been posted. Click here to access the post.

Emipro Technologies is best in Odoo & eCommerce Application development based outsourcing software firm. We deliver any kind of complex solutions in the domain of Odoo and eCommerce to customers accross the globe. Being in IT business since 2011, We have a strong team of skilled experienced IT experts.Our customers are companies of all sizes ranging from startups to large enterprises who realize that they need a professional internet solution to generate revenue streams, establish communication channels or streamline business operations.

Our Services in Odoo includes,
  • Installation
  • Customization
  • Configuration
  • Software Training
  • After Sale Support
  • Maintenance
  • Consulting
Contact info@emiprotechnologies.com for any kind of queries in Odoo. Visit www.emiprotechnologies.com for more details.




 

Sent by Odoo S.A. using Odoo about Forum Post How to create Dropdown list in a custom module and the values for dropdownlist fetches from database?

yogesh
on 3/24/15, 8:41 AM

No, No need to use any widget. Just add this field into .xml. It will work as like normal selection field.

Emipro Technologies Pvt. Ltd.
on 3/24/15, 9:09 AM
Thanks for the answer.
I want to dynamically bring the values from one of the field of same module.
Please let me know your comments.

On Wed, Mar 25, 2015 at 11:32 AM, YOGESH E <yogeshitprof@gmail.com> wrote:
Thanks for the answer.
I want to dynamically bring the values from one of the field of same module.
Please let me know your comments.

Regards,
YOGESH 

On Wed, Mar 25, 2015 at 11:28 AM, Alby Antony <albyantony23@gmail.com> wrote:

A new answer for How to create Dropdown list in a custom module and the values for dropdownlist fetches from database? has been posted. Click here to access the post.

--
Alby Antony


yogesh
on 3/25/15, 2:13 AM
2

Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
Tiny ERP Pvt Ltd
http://www.odoo.com
5975
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.

 

Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 

 

We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :

 

  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 3/24/15, 7:39 AM

Hi,

You can see this type of custom dropdownlist (selection) into pricelist file of product module. It looks like below.


def _price_field_get(self, cr, uid, context=None):

mf = self.pool.get('ir.model.fields')

ids = mf.search(cr, uid, [('model','in', (('product.product'),('product.template'))), ('ttype','=','float')], context=context)

res = []

for field in mf.browse(cr, uid, ids, context=context):

res.append((field.name, field.field_description))

return res

_columns = {

"field" : fields.selection(_price_field_get, "Product Field", size=32, required=True, help="Associated field in the product form."),

}

Here 'field' is selection and its data is comes dynamic from the method "_price_field_get".

I hope you will get custom dropdownlist.

1
Alby Antony
On 3/25/15, 1:58 AM

'field_name': fields.selection('table_name','String',required=True),

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

2 follower(s)

Stats

Asked: 3/24/15, 6:49 AM
Seen: 1733 times
Last updated: 3/25/15, 2:15 AM