Commit Graph
17 Commits
Author SHA1 Message Date
Lucas Lefèvre 645ae69bb9 [FIX] web: Correctly aggregate values in exported parent groups
When exporting a grouped list view with some nested groups, the aggregate value
of parent groups are not correct. It always sums aggregated values of children
whether the group operator is 'sum' or not (could be 'max', 'avg', ...).

This behavior is wrong and can even lead to a crash if the aggregated field is a
date field (e.g. with group_operator='max'). (Try two sum two dates...)

The quick fix 85cf47f was merged just before OXP to avoid any crash. This fix
limited the support of aggregates to only int and float fields.
This commit remove this limitation.

This commit correclty implements the aggregation for parent group for all
field types and all group_operator.

This commit also improves the export feature tests.

X-original-commit: 5e7e4fa98698967e3c4fd0903f4aa8e91981a6cd
2019-10-16 15:49:49 +00:00
Lucas Lefèvre 5c4544fb29 [IMP] web: Export grouped list view in xls file
PURPOSE
=======

Add the support of grouped exports.
Allow the user to export all records in one click from
the listview, without having to go through the export modal,
taking into account the domain, groupbys, and visible fields.

SPECIFICATION
=============

When exporting (whether it is from the modal or from the shortcut),
any groupby(s) set on the listview should be taken into account (all unfolded)
- UNLESS the export is import-compatible
- each subgroup header has an indentation compared to its parent
- the 'group headers' in the exported file should contain the
  same info (label, field aggregates) as it has in the listview.

New secondary button on the tree view with label 'EXPORT' (to be confirmed...)
- the export shortcut disregard the selected records, it exports all records
  according to the domain.
- the button is visible even if there is no selected records.
- essentially the export shortcut does the same thing as the following:
    - select all records
    - hit 'action' then 'export'
    - hit 'export'

Define a boolean attribute on <tree> to specify whether or not the export shortcut should be displayed

Task 2072910
2019-09-20 16:18:35 +02:00
Lucas Lefèvre 2849b5cb39 Revert "[IMP] web: Export list view as XLS file"
This reverts commit ac00548b28.
2019-09-19 14:00:49 +02:00
Lucas Lefèvre ac00548b28 [IMP] web: Export list view as XLS file
Purpose
=======

Have a quick export feature.

The current export wizard is quite complex.
We want to be able to quickly export a tree view,
with the group by correctly represented, depending on the fields
visible in the list view.

Specification
=============

Add an "EXPORT (XLS)" button in the list view (a little download icon)
- export only columns visible in list view
- export all the records
- while respecting the group by

This should be a generic feature but should be applied to all
the account.move.lines list views.
account.view_move_line_tree_grouped_sales_purchases
account.view_move_line_tree_grouped_bank_cash
account.view_move_line_tree_grouped_misc

Task 2031835

closes odoo/odoo#36943

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-16 13:57:40 +00:00
Nicolas Lempereur ce6e66cef9 [FIX] web: bar chart no crazy with 2 group by
In 3d2ca8104e some change were introduced to the graph view.

But part of it had no sense when displaying data over 2 group by.

eg. if the first level has 2 groups (2018, 2019) and each second level 2
    groups (Done,Cancelled), we could have:
     2018/Done: 0
     2018/Cancelled: 5
     2019/Done: 8
     2019/Cancelled: 9
    this gives us two main groups [2018: 5] / [2019: 17], the code
    remove the 2018 because [2018/Done] is 0 so we have something odd
    with columns not in order, and in stacked bar chart some part of
    a bar at the wrong offset

opw-1932517
closes #30529
2019-01-24 16:18:19 +00:00
Christophe Monniez 3f0ebca192 [IMP] web: New test to test Odoo menus
This commit adds a new js test in web that enters each app and click on
each view switcher, each menu and each search filter.

This test is tagged '-standard' and 'click_all' as it could last a long
time, that way it's not executed by default.

It could also be started from the browser console with
'clickEverywhere();'.
2018-08-29 16:57:27 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
fwi-odoo 7d487c00a6 [IMP] web: remove void file, replace openerp tags, add license, clean imports 2016-08-03 13:42:00 +02:00
Simon Lejeune ee697920f5 [FIX] web: re-enable test_menu.py without the mock-menu test 2014-10-10 18:12:59 +02:00
Simon Lejeune 195fa93168 [MERGE] backend front end integration
Render the top-menu (backend menu or frontend editbar) server-side.
Use Fontawesome icons (mail, timezone, chat).
Refactor website widgets, split Website.editorBarin editorbar, ace, editorbar- content, editorbarCustomize.
2014-06-27 11:03:34 +02:00
Antony Lesuisse d9eec7345b convert js tests to HttpCase
bzr revid: al@openerp.com-20140428152857-h7z61vdw5crezv2u
2014-04-28 17:28:57 +02:00
Antony Lesuisse 85d37619e4 [IMP] add test_ui
bzr revid: al@openerp.com-20140209232001-1efvws2pzeldbuhb
2014-02-10 00:20:01 +01:00
Antony Lesuisse c954e9adf2 fix web tests
bzr revid: al@openerp.com-20140209004310-0jpc29beh7k1e27c
2014-02-09 01:43:10 +01:00
Martin Trigaux 4b7799c0c7 [IMP] search_read: use search_read from the orm instead of rewritting it
skip search_count when getting no result from search_read
remove useless test based on implementation details

bzr revid: mat@openerp.com-20140117120047-9b5emsrbtjauvegl
2014-01-17 13:00:47 +01:00
Xavier Morel 4a5cb1ebc4 [REM] EVALPOCALYPSE PART 2: no more python-side eval
trigger an error if a nonliteral context is pushed to the server (through a new object_hook)

bzr revid: xmo@openerp.com-20121126140525-ni2x5m56upss610b
2012-11-26 15:05:25 +01:00
Xavier Morel 5040c649c4 [FIX] add JS test integration with unittest/runbot runner
bzr revid: xmo@openerp.com-20121030132106-gggi4vmwjwq4l2mj
2012-10-30 14:21:06 +01:00
Xavier Morel a933c17e54 [FIX] integrate web tests into buildbot runner, fix broken tests
* Remove deprecated tests and dead code
* Fix usage of mock
* Moar fixes

bzr revid: xmo@openerp.com-20120910105129-rxh3jqwkewh65rl3
2012-09-10 12:51:29 +02:00