changeset 9b3dd281c12b in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=9b3dd281c12b
description:
        Add list-form view

        issue8185
        review255091002
diffstat:

 CHANGELOG                  |   1 +
 doc/topics/views/index.rst |  14 +++++++++++++-
 trytond/ir/ui/view.py      |   3 +++
 3 files changed, 17 insertions(+), 1 deletions(-)

diffs (64 lines):

diff -r 92c25177eff1 -r 9b3dd281c12b CHANGELOG
--- a/CHANGELOG Mon Apr 08 10:14:39 2019 +0200
+++ b/CHANGELOG Mon Apr 08 15:06:36 2019 +0200
@@ -1,3 +1,4 @@
+* Add list-form view
 * Do not set id for on_change calls if cached
 * Add cache on RPC
 * Remove support for Python 3.4
diff -r 92c25177eff1 -r 9b3dd281c12b doc/topics/views/index.rst
--- a/doc/topics/views/index.rst        Mon Apr 08 10:14:39 2019 +0200
+++ b/doc/topics/views/index.rst        Mon Apr 08 15:06:36 2019 +0200
@@ -29,12 +29,14 @@
   </record>
 
 
-There is three types of views:
+There are different types of views:
 
     * Form
 
     * Tree
 
+    * List-Forms
+
     * Graph
 
     * Board
@@ -619,6 +621,16 @@
 
     * ``help``: see in common-attributes-help_
 
+List-Form view
+==============
+
+The list-form views use the same schema as the form views.
+
+List-forms display records as a list of editable forms.
+
+.. note:: The performance of the list-form does not allow to scale well for
+          large number of records
+
 Graph view
 ==========
 
diff -r 92c25177eff1 -r 9b3dd281c12b trytond/ir/ui/view.py
--- a/trytond/ir/ui/view.py     Mon Apr 08 10:14:39 2019 +0200
+++ b/trytond/ir/ui/view.py     Mon Apr 08 15:06:36 2019 +0200
@@ -44,6 +44,7 @@
             ('graph', 'Graph'),
             ('calendar', 'Calendar'),
             ('board', 'Board'),
+            ('list-form', "List Form"),
             ], 'View Type', select=True,
         domain=[
             If(Bool(Eval('inherit')),
@@ -100,6 +101,8 @@
         key = (cls.__name__, type_)
         rng = cls._get_rng_cache.get(key)
         if rng is None:
+            if type_ == 'list-form':
+                type_ = 'form'
             rng_name = os.path.join(os.path.dirname(__file__), type_ + '.rng')
             with open(rng_name, 'rb') as fp:
                 rng = etree.fromstring(fp.read())

Reply via email to