Commit Graph
144 Commits
Author SHA1 Message Date
Hiral Bhavsar b2de618f9f [IMP] base,mail: allow to customize the activity view
The activity view has been greatly improved to allow to customize it
more easily. It works quite similarly to the kanban view, defining
`<field>` tags at the top and using these fields in the `<template>`
section. The template name used to define the activity cards is
`activity-box`.

Note that these activity cards are rendered using `KanbanRecord` widget
(this has implied that ActivityView inherits from `BasicView`).

Also note that the view validation has been moved in base to include the
common grammar.

Task 1894990
2019-05-03 10:19:40 +00:00
9b90d8727d [IMP] web: enable drag&drop in ungrouped kanban views
With this rev., the resequencing feature (with drag and drop) that
was already available in list views is now available also in kanban
views having a field with widget="handle". This works for main as
well as x2many kanban views.

Some code handling the resequencing has been moved from the list
components (controller and renderer) to the basic ones, so that the
logic is shared between list and kanban.

Task 1902808

closes odoo/odoo#28581

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


Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-04-23 13:45:15 +00:00
Aaron BohyandMartin Geubelle 9fbb4fb44f [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>
2019-04-02 11:55:57 +00:00
Martin Geubelle 015958dc17 [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
2019-04-02 11:55:57 +00:00
Aaron Bohy 2be28d4d03 [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
2019-04-02 11:55:57 +00:00
Aaron Bohy 5895d23cbd [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
2019-04-02 11:55:57 +00:00
Aaron Bohy 55676110c8 [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.
2019-04-02 11:55:57 +00:00
Aaron Bohy 7024f8d58b [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.
2019-04-02 11:55:57 +00:00
Sarah Van Bogaert ce4713cd0e [IMP] web: allow multiple fields in form views
This feature was already working in the actual version of Odoo but it is now tested. The following
features are supported:
- When the value of one widget is modified, the other ones change accordingly
- The modifiers 'invisible' and 'readonly' are applied correctly if they differ between widgets.
However, the modifiers 'required' must be equal for the several fields, otherwise the behavior
is not guaranteed.

closes odoo/odoo#32158

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-03-27 13:32:53 +00:00
David Monjoie addeae990f [IMP] base,doc: add scales attribute to gantt view
closes odoo/odoo#31210
2019-02-19 08:28:29 +00:00
David Monjoie 7c48315d7a [IMP] base,doc: add offset attribute
Depending on the scale, the number of units to add to today to
compute the default period. Examples: An offset of +1 in default_scale
week will open the gantt view for next week, and an offset of -2 in
default_scale month will open the gantt view of 2 months ago.
2019-02-19 08:27:53 +00:00
David Monjoie 867df179ca [IMP] base,doc: re-add consolidation feature to gantt view
closes odoo/odoo#31159
2019-02-18 07:23:32 +00:00
57b5e8d9f5 [IMP] base, doc: adapt according to the new gantt view
The view has been rewritten from scratch so the doc and the RNG validation
needed to be adapted.

Co-authored-by: dmo-odoo <dmo@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Co-authored-by: jat-odoo <jat@odoo.com>

See odoo/enterprise#3437

Task 1856235
2019-02-14 16:44:40 +00:00
3a5f6bfa9f [IMP] web: add kanban searchPanel
This rev. defines a searchPanel widget used in Kanban views to
refine search according to specific dimensions. This wigdet is
displayed as a sidebar to the left of the kanban view.

Part of task 1892462

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2019-02-13 12:23:28 +00:00
Aaron Bohy c9eb44d729 [IMP] web: expose context in kanban templates
This rev. allows to use variable 'context' in kanban view
templates.

Part of task 34045

PR: #30881
2019-02-06 13:20:19 +00:00
Xavier Morel 58e0c88ece [ADD] web: server-side-rendered qweb templates as views 2019-01-29 10:22:18 +00:00
Martin Geubelle 212ca45660 [FIX] web, *: restore context key on search view field
Since the control panel refactoring, the `context` key on a `<field>` in the
search view was ignored (like <field name='pricelist' context="{'pricelist': self}".

The previous behaviour has been reintroduced and modified a little bit.

For way too long, an ugly hack was used to get a numerical value in self. This
ugly hack was still present but wasn't working since 8.0 (at least for the
numerical value). A counter hack (see odoo/odoo@4a81e8a) was then applied to
avoid really using a `selection` widget. To get even more confused, `self` was
replaced by the *last* user-specified value.

Well, it's time to clean this mess.

Now, the `self` key is replaced by an array of user-specified values (by value,
we mean the field value i.e. the `id` for a many2one, or the `key` for a
selection field).

Task 1902826

closes odoo/odoo#30368
2019-01-18 16:06:44 +00:00
len-odoo 24f7c7ce7f [FIX] web: add support for string and invisible attributes in pivot view
The pivot view may sum fields that are not really summable:
    unsigned values (e.g. in the case of refunds)
    values in different UOM, currencies (any different units really)
Which causes confusion when these fields are displayed.

We add support for the string and invisible attributes in the pivot view,
so that a field can be given a more informative name or hidden altogether.

opw 1909046

closes odoo/odoo#29144
2018-12-03 15:03:58 +00:00
Christophe Simonis b81c2bce84 [MERGE] forward port branch saas-11.4 up to 3c108977c1 2018-10-22 16:59:51 +02:00
Christophe Simonis 0fcb28c97b [MERGE] forward port branch saas-11.3 up to d82a907728 2018-10-19 14:32:09 +02:00
Aaron Bohy d82a907728 [FIX] web: kanban quick create when grouped by selection
Rev. 42e1efded5 aimed to disable the quick create feature when
grouped by date(time) fields, by only enabling it for char, boolean
and many2one fields. However, the selection case is quite important
and must be handled as well. This is what this rev. does.

Task 1878254
2018-10-19 13:15:31 +02:00
Christophe Simonis f2ada1560e [MERGE] forward port branch 11.0 up to 22a13073f0 2018-10-19 12:25:17 +02:00
Aaron Bohy 22a13073f0 [FIX] web: kanban quick create properly disabled
when grouped on field types for which it isn't supported.

Rev. 42e1efd disabled the quick create feature when the view is
grouped by date(time) fields. However, it hasn't been correctly
forwardported to 11.0 (with the new views). Indeed, the check was
done only once, at the initilization of the view. So if the user
selected another field to group by afterwards, the quick create
feature wasn't enabled/disabled accordingly.

Moreover, we didn't check if it was available when the user clicked
on CREATE in the control panel. So even if it wasn't (and thus if
there were no '+' icon in the columns), when the user clicked on
CREATE, the quick create widget was inserted in the first column.

This rev. fixes both issues.

Task 1878254

closes odoo/odoo#27867
2018-10-19 06:56:40 +00:00
Mathieu Duckerts-Antoine ebd23f36fb [REF] doc: update search view documentation
closes odoo/odoo#27893
2018-10-17 13:03:28 +00:00
svs-odoo 9095592a46 [DOC] document value_label attribute
Document 'value_label' attritube of dashboard aggregate and formula.
2018-09-26 09:33:58 +02:00
svs-odoo fa4c650b01 [IMP] web: limit number of open columns in kanban view
With this commit, we limit the kanban view to 10 open groups
at the start. This is useful to prevent the web client to make
too many requests at once.

This limit is set in the constant 'OPEN_GROUP_LIMIT'.
Note:
- columns already set as folded by default aren't take into account.
- the user can still open any folded column, as usual.

Task #1878113 (1/2)
2018-09-25 17:23:52 +02:00
Adrien Dieudonne a533b9f290 [FIX] web: graph_renderer: show graph title
Since odoo/enterprise@e3b0d2a, the title wasn't set anymore.

This logic is now moved in the graph renderer to be able to
set a title in every graphs.

For now, we only use the title attribute for pie charts embedded
in dashboard views.
Additional tests has been added in 'web_dashboard' (enterprise).
2018-09-24 13:22:06 +02:00
Thibault Delavallée 6663ff97b6 [IMP] web: add an option to hide archive option in kanban columns
Currently kanban columns propose an Archive / Unarchive option if the
records model has an active field. It allows to directly archive or
restore all records belonging to that column. It is currently not possible
to control whether this option is present or not as it only depends on the
active field being defined on the model.

In some specific cases we want to be able to hide this option even if the
active field exists. For example future commits will hide this option for
leads (crm.lead) as business flow goes through marking them as won or lost
instead of archiving / restoring them.

This commit adds support of a new archivable parameter when defining the
kanban view that hides the archive buttons if it is set to False. Default
value is true so that current behavior is kept as it is by default.

Doc and tests are added.

This commit is linked to task ID 1880051 and PR #26977.
2018-09-21 11:22:01 +02:00
Christophe Simonis 9c77066f34 [MERGE] forward port branch saas-11.4 up to 6c103589c1 2018-09-14 16:00:17 +02:00
Christophe Simonis f3fa5a5ef7 [MERGE] forward port branch saas-11.3 up to 1e0a92c996 2018-09-13 19:30:33 +02:00
Christophe Simonis 1e0a92c996 [MERGE] forward port branch 11.0 up to 5cb9f8e9d5 2018-09-13 12:42:01 +02:00
len-odoo 83292e522a [FIX] doc: add documentation for widget formatter support in pivot view
Commit:
https://github.com/odoo/odoo/commit/8c1204954ef571e51e94ddf4070043ec2d5de3c6
put back support in v11 for formatter widgets in pivot views.
We document this feature.

opw 1876445
2018-09-12 19:46:40 +02:00
Martin Geubelle e273407157 [FIX] mail: consider activity as a valid view type
The recently introduced `activity` view (see rev. odoo/odoo@1de9496 has not
received all the consideration it deserves as a real view type (no RNG, not in
the valid view `type`, no doc, etc.). It was currently only working based on a
`_get_default_activity_view` method.

Even if the RNG is currently really basic, its grammar could evolve in the future.

This was causing an issue when opening Studio with this view as a default view
with an invalid type was created.
2018-09-03 13:40:22 +02:00
Dharmraj Jhala 03ed4470b4 [IMP] doc: document timeline attribute on cohort view
Task 1854339
Closes #25576
2018-08-13 16:32:40 +02:00
RomainLibert 14676c5aa1 [DOC] web_cohort: add context keys 2018-07-31 11:33:17 +02:00
eco-odoo c1498ff36b [IMP] web: add option to display a banner above a view
Add a banner_route attribute to AbstractView to allow fetching html from a
controller route and displaying it above the view.

The initial use case was the onboarding panels.

Supported views are the ones inheriting both AbstractView and AbstractController.
2018-07-20 11:59:12 +02:00
RomainLibert c6396c36e7 [DOC] dashboard: add clickable attribute on aggregates
Closes: #25710
2018-07-19 09:51:54 +02:00
Sébastien Theys f241441433 [IMP] web: add control + create tags to customize "add a line"
The default "add a line" button creates a new line with the default values from the model. Sometimes we want to create a new line with different default values (or more generally a customized context), which is possible with this commit. Moreover it is possible to create multiple buttons for multiple default values/contexts.

This works both for in-line creation ("editable=") and dialog creation.

The new tags are:

<control> defines custom controls for the current view.

Does not support any attribute, but can have children:

<create> adds a button to create a new element on the current list.

This makes sense when the parent tree view is inside a One2many field.

If any create is defined, it will overwrite the default "add a line" button.

For more information and example, have a look at the Views documentation.

Technically, the commit will:
- parse the new XML tags (+ add appropriate validation)
- display the buttons based on the XML
- on button click/keyboard: pull up the additional context information from the button event up to the default_get
- add unit tests
- add documentation

PR #25209
2018-07-17 11:50:35 +02:00
RomainLibert 0bb5268cb3 [DOC] add measure attribute to aggregate
Closes #25713
2018-07-13 16:11:28 +02:00
RomainLibert 8a21e27377 [IMP] web: add auto sorting on pivot view
We add the attribute default_order on the pivot view (already present in
graph view), this attribute will sort the pivot view on the given
measure.

Closes: #25675
2018-07-11 13:47:01 +02:00
RomainLibert 5bf5d45b7d [DOC] dashboard: add help attribute and mention count_distinct
Documentation needed some update
2018-07-11 13:02:54 +02:00
RomainLibert a1c422d2de [DOC] pivot,graph: add documentation on alphabetical sort
As pivot and graph measures are now automatically alphabetically sorted,
we need to update the documentation
2018-07-10 12:25:52 +02:00
RomainLibert 9509238079 [DOC] split graph and pivot documentation
Pivot view documentation was still inside the graph view documentation
as it was previously only a mode of this graph view.

As the pivot is now an entirely different view, it has the right to have
it's own documentation.
2018-07-10 12:25:24 +02:00
Mathieu Duckerts-Antoine 11b7857af6 [DOC] web: improve documentation of search view 2018-07-06 14:09:09 +02:00
RomainLibert 0f48701384 [DOC] web_cohort: documents mode attribute
Closes #25512
2018-07-04 16:42:08 +02:00
Martin Geubelle aabe35c76c [DOC] add documentation for position='move'
Feature merged in odoo/odoo@eee245c
2018-06-04 09:52:08 +02:00
Géry Debongnie 5b19d05a9a [DOC] add documentation for the new cohort view 2018-05-31 10:36:58 +02:00
Christophe Simonis 5a751fa200 [MERGE] forward port branch saas-11.2 up to aae54ecc15 2018-05-09 15:45:20 +02:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Géry Debongnie e0424b9603 [FIX] web: fix form_view_id attribute in calendar view.
The way the calendar view selected its form view was broken for two
reasons:

- any value given in the form_view_id attribute was kept as string,
  which means that the string value would be sent to the server, and
  this is not good.
- if no value was set, the calendar view then simply did a do_action
  with the form view id set to false, which means that the default form
  view is used.  This is mostly ok, except when we are in the context of
  an action with a form view which is not the default one.  In that
  case, we clearly prefer the form view from the action.

For example, before this commit, the form view in the timesheet
application (community) is not the same as the default form view on
account.analytic.line.

Note that this commit also adds a small tweak to the mock server to
better simulate errors like the web client does (in session.js).
2018-05-02 10:51:45 +02:00