This question has been flagged
1 Reply
2518 Views

I have two fields

<field name="dest_location" />
<field name="new_project" on_change="onchange_location_id(new_project)" />

I want, when i choose new_project, all its corresponding location will display in dest_location.

But i also need, when i choose dest_location, all its corresponding location will display in new_project.

I cant use onchange function. Its has right!

Any another option?

i tried using domain, but no output.

 

Avatar
Discard
Best Answer

I see the problem is looping onchange. Then why don't you add second arg in the onchange function, or context, to flag non changed value. I think the second argument would be the other field.

It's not elegant, but I think it can be done that way.

Avatar
Discard
Author

Problem is looping. but i didnt get you about the second arg or context or flag. how can use in my onchange function?

Like: on_change="onchange_location_id(new_project, dest_location)". Of course, you have to update the code and consider the dest_location. if the relation new_project ~ dest_location satisfied then you don't have to update new value.