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.

1

How to add values to drpdown from a function?

By
aneesh ATEES Infomedia Pvt Ltd
on 7/31/15, 11:41 PM 304 views

How to add values to dropdown from a function.That means i want to return values to dropdwon from the function in the __py file

i want to display customer have at least one sale order..many2 one filed shows all the customer wen using res.partner. 2.wen using sale.order with one2many which shows correct count but display sale order number.i want customer number instead of sale order number

aneesh ATEES Infomedia Pvt Ltd
on 8/1/15, 12:24 AM
1

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 8/1/15, 2:26 AM

Do you mean by a dropdown a many2one field in an Odoo/openERP view ?

create a calculated field in the res.partner table that holds the count of the sales order created for this customer, name it 'sale_count'. Make this field searchable.

in the many2one field that shows the customers add a domain filter as

domain = [('sale_count','>',0)]

I hope this works

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: 7/31/15, 11:41 PM
Seen: 304 times
Last updated: 8/17/15, 5:37 AM