Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] web,*: list view improvements #31756

Closed
wants to merge 11 commits into from

Conversation

Projects
None yet
7 participants
@mge-odoo
Copy link
Contributor

mge-odoo commented Mar 11, 2019

This branch brings several improvements related to the list view:

  • grouped list views are now editable
  • 'expand' attribute can be used to open by default the first level groups
  • if there are a lot of groups, a pager is displayed (instead of having all
    groups in the same page)
  • when grouped on a many2one field, custom buttons (on the many2one
    comodel) can be inserted in each group's header
  • we can edit several records in a row in editable list views
  • editable lists do not flicker anymore when switching a row to edit mode
  • we can navigate through the cells in list views with the arrows (in
    readonly)

Co-authored-by: Aaron Bohy aab@odoo.com
Co-authored-by: David Monjoie dmo@odoo.com
Co-authored-by: Martin Geubelle mge@odoo.com
Co-authored-by: Ravi Gadhia rga@odoo.com

Task 1915702

@robodoo robodoo added the seen 🙂 label Mar 11, 2019

@C3POdoo C3POdoo added the RD label Mar 11, 2019

@mge-odoo mge-odoo force-pushed the odoo-dev:master-listview-imp branch to 0141840 Mar 13, 2019

@robodoo robodoo added the CI 🤖 label Mar 13, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch from 0141840 Mar 15, 2019

@robodoo robodoo removed the CI 🤖 label Mar 15, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch to 9653ad3 Mar 15, 2019

Show resolved Hide resolved addons/web/static/src/js/views/list/list_renderer.js Outdated
Show resolved Hide resolved addons/web/static/src/js/fields/relational_fields.js Outdated
Show resolved Hide resolved addons/web/static/src/js/fields/relational_fields.js Outdated
Show resolved Hide resolved addons/web/static/src/js/views/basic/basic_model.js Outdated
Show resolved Hide resolved addons/web/static/src/js/views/basic/basic_model.js Outdated
*
* @returns {array}
*/
getRecordIDList: function () {

This comment has been minimized.

Copy link
@aab-odoo

aab-odoo Mar 15, 2019

Contributor

maybe not necessary (used by the navigation (ENTER) to move from a group to another)
if necesseary, we may move this to the datapoint directly (?)

Show resolved Hide resolved addons/web/static/src/js/views/list/list_editable_renderer.js Outdated
Show resolved Hide resolved addons/web/static/src/js/views/list/list_editable_renderer.js Outdated
* @param {position} [options.position] position previous and next
* @returns {integer}
*/
_getNavigationLineIndex: function (index, options) {

This comment has been minimized.

Copy link
@aab-odoo

aab-odoo Mar 15, 2019

Contributor

see with fp what we want, but this is probably wrong (see commented test)

Show resolved Hide resolved addons/web/static/src/js/views/list/list_editable_renderer.js Outdated

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 18, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch from 1485234 to 473642d Mar 18, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 18, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch from adb8012 to d2b8159 Mar 20, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 20, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch 4 times, most recently from 805d5e2 to 2fd2a21 Mar 21, 2019

@robodoo robodoo added the CI 🤖 label Mar 26, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch from 80cbae8 to d00a775 Mar 27, 2019

@robodoo robodoo removed the CI 🤖 label Mar 27, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch 2 times, most recently from d4b5b25 to dd6f378 Mar 27, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 28, 2019

@robodoo robodoo added the CI 🤖 label Apr 1, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch from 02b1ac9 to c5952ae Apr 2, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 2, 2019

rga-odoo and others added some commits Jun 6, 2018

[IMP] web: list: editable grouped list views
This rev. enables the editable feature in grouped list views.

Part of task 1915702

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
[REF] base,account: list: remove deprecated attrs
The 'toolbar' attribute is not referenced in the documentation, and
it has no effect since at least v10.

The 'on_write' attribute was referenced in the documentation, but
is no longer used in Odoo and has no effect since at least v11.

The 'colors' and 'fonts' attributes are deprecated since v9, and
have no effect since v10.

The 'string' attribute is deprecated since v8 and has no effect
since v9. However, it is widely used in Odoo, so we must remove
all occurrences before removing it from the rng.
[IMP] web: list: import attrs
The 'import' attrs is valid according to the rng definition of the
list view. It is used in a few views in Odoo. However, it didn't
actually work (in most cases, it worked by chance because it is
set to "0" in addition to create="0", and create="0" already
disables the import feature).

With this ref, the 'import' attrs is taken into account and we
can now disable the import feature even if the create one is
enabled. Moreover, it is now documented.
[IMP] web: list: add expand attrs
When this attribute is set to true on the <tree> root node, in a
grouped list view, first level groups are automatically opened.

Part of task 1915702
[IMP] web,board: enable pagination in grouped lists
With this rev., when there are a lot of groups in a grouped list
view, groups are displayed under several pages, whereas they were
all displayed in the same page before.

This is especially interesting with the new 'expand' attribute, to
ensure that we don't read records for a large number of groups.

By default, the groups limit is set to 80 (like records), and to 10
is the 'expand' attribute is set to true. This limit can be
overriden with the 'groups_limit' attribute.

Part of task 1915702
[IMP] web,base: put buttons in list group headers
It is now possible to put buttons in the list view group headers.
When the view is grouped by a many2one field, those buttons
appear next to the header title when the group is opened.

The buttons are specified in the views in a <groupby> tag in the
list arch, with the following structure:
    <groupby name="groupedField"> <!-- must be a many2one -->
        <button type="object" name="my_method" string="Button1"/>
    </groupby>

It is also possible to add `field`, inside the `groupby` which can
be used for modifiers. These fields thus belong on the many2one
comodel, like:
    <groupby name="partner_id">
        <field name="name"/> <!-- name of partner_id -->
        <button type="object" name="my_method" string="Button1"
		attrs="{'invisible': [('name', '=', 'Georges')]}"/>
    </groupby>

These extra fields are fetched in batch when grouping on the field.

Part of task 1915702
[IMP] web: editable list: table-layout: fixed
This rev. changes the layout of *editable* list views to a fixed
layout. This means that we are now responsible of the width of
each column. To do that, we associate with each field type a
factor, and the higher the factor is, the larger the column will
be (w.r.t. the others). This default value can be overriden in the
arch.

The fixed layout allows to remove the absolute positionning of
widgets inside editable lists (done in the next commit).

Part of task 1915702

Co-authored-by: Martin Geubelle <mge@odoo.com>
[IMP] web,account: editable list: no more position absolute
Before this rev., widgets were absolutely positioned in table
cells. This cause an undesired effect with text fields, as their
textarea overflowed and overlapped the next lines.

With this rev., wigdets are now statically positioned, and the cells
height and width don't change when switching a row to edit mode.

Part of task 1915702
[IMP] web: allow mass update in editable lists
From an editable list view, if you select several lines then change
a field, you are now asked if you want to apply the same change on
all selected lines. If you accept, a write is directly performed
(without applying onchange, as the records are reloaded and the view
re-rendered). If you decline, the classic behavior still occurs.

Part of task 1915702
[IMP] web: list: directional keys navigation in readonly
With this rev., it is now possible to navigate with arrows in list
views (except when editing, as in this case hitting the arrows moves
the cursor in the input/textarea), and to expand/collapse groups
with keyboard navigation.

Part of task 1915702
[IMP] web: fetch records alongside read_group
This rev. adds params to the 'web_read_group' method, allowing to
search_read records inside each groups in a single RPC, instead of
doing a 'web_read_group' RPC followed by n 'search_read' RPCs,
where n is the number of opened groups.

Part of task 1915702

@aab-odoo aab-odoo force-pushed the odoo-dev:master-listview-imp branch from 670c0b8 to a26e580 Apr 2, 2019

@robodoo robodoo removed the CI 🤖 label Apr 2, 2019

@VincentSchippefilt

This comment has been minimized.

Copy link
Contributor

VincentSchippefilt commented Apr 2, 2019

robodoo r+

@robodoo robodoo added the r+ 👌 label Apr 2, 2019

@VincentSchippefilt

This comment has been minimized.

Copy link
Contributor

VincentSchippefilt commented Apr 2, 2019

robodoo rebase-merge

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Apr 2, 2019

Merge method set to rebase and merge, using the PR as merge commit message

@robodoo robodoo added the CI 🤖 label Apr 2, 2019

robodoo added a commit that referenced this pull request Apr 2, 2019

[MERGE] web,*: list view improvements
This branch brings several improvements related to the list view:

- grouped list views are now editable
- 'expand' attribute can be used to open by default the first level groups
- if there are a lot of groups, a pager is displayed (instead of having all
groups in the same page)
- when grouped on a many2one field, custom buttons (on the many2one
comodel) can be inserted in each group's header
- we can edit several records in a row in editable list views
- editable lists do not flicker anymore when switching a row to edit mode
- we can navigate through the cells in list views with the arrows (in
readonly)

Co-authored-by: Aaron Bohy aab@odoo.com
Co-authored-by: David Monjoie dmo@odoo.com
Co-authored-by: Martin Geubelle mge@odoo.com
Co-authored-by: Ravi Gadhia rga@odoo.com

Task 1915702

closes #31756

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Apr 2, 2019

Merged, thanks!

@robodoo robodoo closed this Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.