← Back to team overview

openerp-community team mailing list archive

Re: adding custom views to the web client

 

I can see two possible directions:

1) The right way: Use a wizard that dynamically builds a vie with the requested columns. You have an excellent example of on-the-fly built views in the module survey.
2) The "lazy" way: Create a view with "n" column place-holders, and make visible only the ones needed at each specific report view. 
   A wizard could ask for the "number_weeks" field, and fields in the view would look like: 
    <field name="key_week12" attrs="{'invisible':[('number_weeks','<',12 )]}" />

From: viktor.nagy@xxxxxxxxxxx
Date: Tue, 31 Jul 2012 23:41:47 +0200
To: openerp-community@xxxxxxxxxxxxxxxxxxx
Subject: [Openerp-community] adding custom views to the web client

hi,
we are moving a 5.0.7 OpenERP installation to 6.1
we have some web-client based reports (not pdf) of the following form
Product   | Week 1 | Week 2 | Week 3 | ... | Week 12 

product 1|  100      |   100     |  100     |  ...| 100      product 2|  100      |   100     |  100     |  ...| 100      product 3|  100      |   100     |  100     |  ...| 100      


that is we have a variable number of columns
as a result, our view data were always generated on the fly, and it was a pain in the ass to have such a view in 5.0.7


given the extensibility of 6.1 I was wondering how to implement the above feature
My best idea would be to write a server API endpoint that would return the following data structure


[{ product: 'product1, week: 1, keyX: valueX,  ... value: 100,},...]
and would digest this on the client side using a web addon


Is this the way to go? After checking the web addons, I have an idea how to do the web client side of the development, but I don't really know how to do the server-side of it.


Am I still restricted to <form>, <tree>, <graph> view architectures, or adding my own <foo> main tag works if there is a correspoding web addon (registered with openerp.web.views.add)?What would be the way to define the server end-point to return the above data structure? Shall I define a custom method on whatever model object I have?

Are there any example of this kind?
thanks for your support and ideas,Viktor

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp 		 	   		  

References