Conditional default view

26 views
Skip to first unread message

Jon Levy

unread,
Jul 15, 2016, 7:53:06 AM7/15/16
to tryton
I have a window with a domain that will usually be satisfied by only a single record.  Think of it as a "your next task to do" window.  In most cases, there will be one "next" task.  However, sometimes there will be zero, and sometimes more than one (the user has fallen behind).  I would like the view to default to form view if there is only 1 record, but default to list view if there are zero or >1 records.  Is this possible?

Sergi Almacellas Abellana

unread,
Jul 15, 2016, 8:17:37 AM7/15/16
to try...@googlegroups.com
El 15/07/16 a les 13:53, Jon Levy ha escrit:
You have to open it from a wizard, and then reverse the action views if
the length of computed pending tasks is one.

You have and example in the account_invoice module, on the wizard used
to credit invoices [1]

Hope it helps!

[1]
http://hg.tryton.org/modules/account_invoice/file/3487c50ee235/invoice.py#l2666

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
Reply all
Reply to author
Forward
0 new messages