On 23/05/17 15:36, Albert Cervera i Areny wrote:
2017-05-23 0:44 GMT+02:00 Oscar Alvarez <oscar.alvarez.mont...@gmail.com>:
On 20/05/17 03:34, Nicolas Évrard wrote:

* Oscar Alvarez  [2017-05-20 00:04 +0200]:

Hi Dev,


Hello Oscar,

I am curious is  it possible set tree view with numbers of Columns dinamic,
so the columns number must to change when Context change or to exist any way
for reach this?


What problems are you trying to solve?


Hi Nicolas,

Dinamic views is important in several cases, the main use is for views used
in reports, for example:

  For balance sheet we need have one view where according to the context
model we can to see just one fiscalyear (1 column), two fiscalyear (2
columns) or three fiscalyear (3 columns) for comparatives in this case a new
column is add/removed when the user click in reload.

  For stock products quantity report could be used for view one, two, three
columns where the columns represent differents warehouses, according to
warehouses selected in context maybe using "active_ids"

                                     Qty                            Qty
         Product        Warehouse 1            Warehouse  2
             A                        5                            2
             B                        7                            3
             C                        1                            25


For sales is useful for comparative reports, where the user could be view
sales for one month or several months (the same fiscal year)

When we want to see just one period:
________________________________________________________________________________________

    Report Sales / Purchase / Invoice Comparative
________________________________________________________________________________________

     Start Period:  2017-02                End Period: 2017-02   <- Many2One
of account.period
________________________________________________________________________________________

Filter:
---------------------------------------------------------------------------------------------------------------------
Party (Customer / Supplier)      |          2017-02           |
---------------------------------------------------------------------------------------------------------------------
Abc Company INC                    |            $100.00          |
Xyz LLC                                    |             $359.00         |
.
.
.

When we want to see a range of periods:

________________________________________________________________________________________

    Report Sales / Purchase / Invoice Comparative
________________________________________________________________________________________

     Start Period:  2017-02                End Period: 2017-04   <- Many2One
of account.period  (Just change "End period" field and click in "Reload", so
then more columns are added to treeview)
________________________________________________________________________________________

Filter:
---------------------------------------------------------------------------------------------------------------------
Party (Customer / Supplier)      |          2017-02      |         2017-03
|        2017-04         |
---------------------------------------------------------------------------------------------------------------------
Abc Company INC                    |            $100.00     |        $500.0
|            $0              |
Xyz LLC                                    |             $359.00    |
$ 0            |          $733            |
.
.
.


This feature make more powerful and flexible reports in views, so the only
way to reach

I don't know maybe there is more people/developers interested in see and
works around  this feature.
That is not possible yet you can find (at least) a couple of workarounds:

- You may take a look at babi module at bitbucket were the user can
configure a report and recalculate it when needed.
Ok thanks for Babi mention, but I can not install babi because is not compatible with python3, I fixed setup.py, but I get still on install:

Traceback (most recent call last):
File "/home/psk/.virtualenvs/tryton40/bin/trytond-admin", line 21, in <module>
    admin.run(options)
File "/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/admin.py", line 48, in run
    Pool(db_name).init(update=options.update, lang=lang)
File "/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/pool.py", line 142, in init
    self.start()
File "/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/pool.py", line 95, in start
    register_classes()
File "/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/modules/__init__.py", line 365, in register_classes
    the_module.register()
File "/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/nantic_babi-4.0.0-py3.5.egg/trytond/modules/babi/__init__.py", line 35, in register
    module='babi', type_='model')
File "/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/pool.py", line 84, in register
    assert issubclass(cls.__class__, PoolMeta), cls
AssertionError: <class 'trytond.modules.babi.babi.ActWindow'>

Yes I know missing Poolmeta, in code, etc, so it whatever changes in Trytond API will break Babi (I dont have doubts about babi works), but the point is I think we need really that features "Dinamic views" inside Tryton core (maybe babi or not, I dont know)

  That calculation
process creates the views that are later shown to the user, and those
may include more or less columns depending on data or how the user
configured the report. Note that its implementation could be greatly
improved by creating model fields on the fly.

- When you create a dashboard it is possible to update the data on one
Thanks I tried dashboard
of the views when a record is selected in another view. There's a
patch * from a long time ago where I proposed a way not only to
refresh data but the whole view. That means, that, for example you
could select a record in one view and it would show you a graph. But
if you select another record, then it shows a calendar, etc. I didn't
work on it further but it could be a nice and simple improvement that
would allow you to do more or less what you're looking for.

* Sorry, I was not able to find it

Oscar Alvarez

--
You received this message because you are subscribed to the Google Groups
"tryton-dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton-dev/d55eb0ba-89de-4800-8383-0c9cda403a9a%40gmail.com.



--
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/fe29cbd6-0e38-d479-3092-c55a2d9f20ce%40gmail.com.

Reply via email to