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 show newly created domain value in my custom field?

By
arsalan
on 8/18/14, 8:06 AM 699 views

I have been working ion a search module in OpenERP-7. The scenario is that I am returning records in domain so that I can show them on my field. The problem here is that the field is not showing the newly created records in the domain. While on printing the value of domain on console, I get the desired records . But I dont seem to get why its not allowing me to view them ion my field. Neither I am getting any error.

My domain part of function is as follows:

res = cr.fetchall()

for p_id,p_name in res:

     domain.append((p_id))

print domain

return {'domain':{'my_products':[('id','in',domain)]}}

 

0

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 8/18/14, 12:53 PM

I think method onchange which return domain doesn't work on field with widget="selection" attribute. Try to remove it.

0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 8/18/14, 8:38 AM

returnig dictionary with 'domain' key works only if it is on_change function.. otherwize you need to refresh / reload the page in order to reload view with new values

yes I am using the on_change function. But the values are not being shown on the field. It is Only showing the old values.

arsalan
on 8/18/14, 8:46 AM

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: 8/18/14, 8:06 AM
Seen: 699 times
Last updated: 3/16/15, 8:10 AM