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

Can we display Columns dynamically in any table? In XML file?

By
Zura Tsiklauri
on 8/27/14, 4:24 AM 1,873 views

 I need to hide/unhide columns in a table base on some conditions. For example after a dialog window, in which user selects which columns to diplay, the table is opend with a selected columns. Is that Technically possible in OpenERP?

3

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 8/27/14, 4:48 AM

As alternative to John Does answer, you can try to use invisible attribute.

In the column selection view add a context that contains a boolean variable for each (un)selected field. In the tree view add all columns and set the invisible attribute according to the context.

e.g.:

<field name="column1" invisible="context.get('column1_invisible',True)"/>
<field name="column2" invisible="context.get('column2_invisible',True)"/>
. . .

 

Regards.

1

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 8/27/14, 4:34 AM

Yes, it is possible but not through XML file.  You can dynamically create any view by inheriting fields_view_get method of the ORM.  A good example is actually how account.move.line's view is dynamically generated based on a user configurable set-up (view_id of the related account.journal) in OpenERP 6.x.  It has been deprecated in 7.0 but the concept of generating view dynamically does not change that much.

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/27/14, 4:24 AM
Seen: 1873 times
Last updated: 3/16/15, 8:10 AM