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

Pass context from server (back-end) to form (front-end)

By
Anton Chepurov
on 2/13/14, 9:12 AM 864 views

Question about dynamic views.

Inside a form view I have a tree view of a one2many field. In this tree view I'd like to hide/show the entire column (not just individual cells) depending on the contents of the parent form view.

AFAIK, the only way to hide the entire column is to use context:

<field name='my_column' invisible="not context.get('showMyColumn',False)">

My question is: How to pass context from server (back-end) to form (front-end)?

I know how to do the opposite (pass context from form to server). And I know how to pass context from button's action function to form:

return {'type': 'ir.actions.act_window', ..., 'context': ctx_updated}

But how to update form's context from the write() method of the form view's object or from it's on_change method of the object's field my column listens to?

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

0 follower(s)

Stats

Asked: 2/13/14, 9:12 AM
Seen: 864 times
Last updated: 3/16/15, 8:10 AM