This question has been flagged
3 Replies
1981 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

Avatar
Discard
Author

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

Best Answer

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

Avatar
Discard