On 6 de gener de 2018 2.06.53 CET, Roei Erez <
roei...@gmail.com> wrote:
>Hi,
>
>We have a system with tests, each Test has a many2one field of User who
>is its executor and a time that the test execution took.
>We would like to show a tree view that shows average time per test and
>when click on a test it is like a pivot table that opens the users and
>show the total per user.
>
>
>Name | Average Time
>
>+Test1 | 2 hours
> User1 1 hours
> User2 | 1 hours
>
>
>We saw such tree views in the client but we would like to implement
>that without inserting real rows into the database for this tree view
>but rather query the information from the existing Test model table
>(using table query maybe?)
Yes you should use a new model which defines the table_query method. This method must return a python-sql query with the computed data. In adition to the displayed data you must compute the id, create_uid, create_date, write_uid and write_date.
In order to open the records detail you can use the tree_open keyword which will trigger a new action. This action will recieve the id of the clicked record on the active_id keyword. So it mus have a domain like:
[('some_field', '=', Eval('active_id'))]
In order to show only the related records on the target model.
>
>Appreciate if someone can help here, or refer me to an example of such
>requirements.
>Thanks.
--
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi brevedad.