Commit Graph
150 Commits
Author SHA1 Message Date
Philémon van HeldenandNicolas Lempereur 1d3c886b95 [FIX] web: no error on single active_ids state load
In eg. 13.0 when refreshing sales analysis action of a product, we would
get an error because we have a single active_ids which is not expected
by the code.

With this commit, we use .toString() on the jQuery BBQ parsed active_ids
as it was done before 32b8cec5 refactoring (january 2018).

The added test with the fix fails with an error:

  TypeError: state.active_ids.split is not a function
  at Class.loadState (/web/static/src/js/chrome/action_manager_act_window.js)

opw-2471982

closes odoo/odoo#70285

X-original-commit: bf9a985f4b62cc6f1eef4f9fcca2a8dfbd453004
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: pvh-odoo <SwagSamaSempai@users.noreply.github.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
2021-05-03 18:01:10 +00:00
Aaron Bohy c14622fcd3 [FIX] web: correctly close confirm dialog
Let's assume the following scenario:
 - have an action in target new (e.g. a form view)
 - in the dialog, have an action/object button with confirm
   attribute
 - when clicking on that button, a confirm dialog opens
 - if validated, the following action returned by the server
   is again an action in target new

Before this commit, the confirm dialog remained in the DOM.

This issue occurred because it's parent wasn't correctly set (wrong
use of `this`), so when the first dialog was destroyed, the confirm
dialog wasn't automatically destroyed in turn.

OPW~2440712

closes odoo/odoo#66597

X-original-commit: 98f9cb4f692a15494cd8ef298673fe1c949c423c
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2021-02-22 12:13:22 +00:00
Michael Mattiello (mcm) 2c3ac6b254 [IMP] web: add quick edit behaviour
This commit adds the quick edit behaviour.
The quick edit allows to click on fields in readonly form view to switch
into edit mode. After switching mode, the clicked field is automatically
focused.
A few fields have a custom quick edit behaviour after mode switched:
  - checkboxes automatically toggle.
  - radio buttons are set to the selected value.
  - one2many list's cell are focused.
One2many list fields now show the "add a line" in readonly mode.

task 2330101
2021-02-02 12:40:23 +00:00
Michael Mattiello (mcm) d1c56ec7c4 [IMP] web, base: auto save
This commit adds the auto save for editable list and form views
but not for settings.

Now with auto save, changing the pager, going back in the breadcrumb,
going to an other action or clicking on a menu item won't ask to
confirm changes if any but will automatically save them.

In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.

task 2330101
2021-02-02 12:40:22 +00:00
Nicolas Lempereur fef9634dfb [FIX] web: show warning on create onchange
When you create a new record, you will have in this order:

- default_get
- onchange (can trigger a warning)
- _pushController => close all dialogs since ea2207afea

This is an issue since the possible warning is directly hidden to the
user.

Without the change, the added test failed with:

 Warning modal should be opened
 "executing a window action with onchange warning do not hide it":
 Found 0 elements to click on, instead of 1

opw-2342273
opw-2374051
closes #61732

closes odoo/odoo#63415

X-original-commit: ff61ab121e3fb3c0c9b269c0dc9a65b3f1c8e664
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-12-15 18:21:14 +00:00
Nicolas Martinelli 9d36b03cbe [FIX] web: report controller in multi-company
- Create 2 companies A & B
- Set a website on company A
- Switch to company B
- Open a done MO
- Open the cost analysis

An AccessError is displayed.

The error arises in:
https://github.com/odoo/enterprise/blob/923cbffe4e60572a5c17ee962d571c037e9cff44/mrp_account_enterprise/reports/mrp_cost_structure.py#L90

The root cause is coming from the call to `/report/html/`, which is
called without any `data`. In this situation, the following adds an
incorrect `allowed_company_ids` in the context:

https://github.com/odoo/odoo/blob/d1413a2f06bcb44b1fbb6dba8658e698c8da4018/addons/website/models/ir_http.py#L196-L205

Indeed, the `allowed_company_ids` is the one from the website, in this
case company A.

The issue doesn't occur when downloading a PDF from the interface since
in this case the `data` dictionary contains the appropriate context
which is set in:

https://github.com/odoo/odoo/blob/d1413a2f06bcb44b1fbb6dba8658e698c8da4018/addons/web/controllers/main.py#L1958

As a solution, we add the `user_context` in the `/report/html` route.

opw-2341747

closes odoo/odoo#59663

X-original-commit: 932e347a90bfd4bf025e4e8e54ef9c66cc49c5d0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-09 14:31:20 +00:00
Lucas Perais (lpe) 9076c0190c [FIX] web: action_manager_tests: concurrency doAction: relax rpc assert
In general, the last actionManager's operation has priority over hanging previous ones.

This means that the order of the  RPC's done by the actionManager is deterministic.
i.e. load_action, load_views
However, when testing the concurrency, some RPC of an hanging actionManager operation
(in this case a switchView to a form triggers a 'read'), may be fired anyway. Those are superfluous
but irrelevant as long as the last displayed item is the one last asked by the user.

This commit fixes the test 'execute a new action while switching to another controller' to not be bothered
with an irrelevant controller's RPC messing with the orders of RPC.
This is admittedly brutal, but justified with the current implementation of actionManager.

closes odoo/odoo#58983

X-original-commit: 4344d50a74b04ffed7a7113e8af2b8ad6800693e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-10-02 11:21:45 +00:00
Xavier Morel 6f4f8f0265 [IMP] auth_totp: notify user on activation and deactivation of OTP
Was not super visible, especially without HR as the dialog immediately
closes (limitation of the web client), or when an administrator user
massively disables totp.

Show a toast notification indicating the success of the action.

Also fix the logging of `totp_disable` so it correctly handles being
called on more than one record, and change the logging data to
<browse_record> (<logins>) across the board.

Also add a way to provide an action to execute after a notification:
by default nothing happens, which leads to dialogs not closing and
forms not reloading, and there is no good way to show a notification
and/then do some other thing, which is inconvenient.
2020-09-10 12:49:00 +00:00
38b7462dcf [REF] web: BasicModel: combine default_get and onchange
This commit adapts the BasicModel to combine calls to `default_get` and
(first) `onchange`.  When creating a new record, we now only call
`onchange`, which thus return default values and potential onchange
values.

Tests (and the MockServer) have been adapted accordingly.

NOTE 1.  If the `default_get` within the `onchange` returns a value for
a field that is not in the view, we ignore it, and it won't be saved.
Before, that value was kept and sent upon save.  This change in behavior
may prove problematic, although the overall risk is small.  Decision has
been made to keep heavy comments and code snippets if we were to revert
back somehow to the previous situation.

NOTE 2.  Putting a context on a many2one field may change the value
returned by `name_get` for that field.  By default, the calls to
`name_get` are done by `onchange`.  If the context on a field must be
used for `name_get`, one has to set the option `always_reload` to `True`
on the field.  In that case, every `onchange` that changes the value
will trigger an extra `name_get`.

NOTE 3.  Suppose that a one2many field has a list view with field A, and
a form view without field A.  When adding a line, we now send all known
fields (main view and inline views) to the `onchange`, which may return
a default value for A.  The value will appear on the list view, but not
in the form view.  The former behavior was to call `default_get` with
the fields that occur in the form view only, and therefore field A would
be left to value `False`.

NOTE 4.  A test surprisingly adds an extra call to `read`.  The test was
actually wrong before.  With the changes in MockServer, we now correctly
receive a command `[6, false, [1]]`, whereas before we received `[1]`,
which isn't a valid command, and which was ignored.  As a consequence,
an extra `read` is done, whereas the test asserts it shouldn't.  But it
already didn't work before (I checked by sending the correct command).
This needs to be bugfixed elsewhere (task-id-2323491): in a o2m with a
onchange and default order records on an other page than the first
should not trigger a `read`.

Task 2261084

Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-08-20 13:39:25 +00:00
Julien Mougenot 2524c7aaac [IMP] web: Do not store search panel categories
This commit handles two things:

1) Move the local storage logic of the search panel into the documents
module.

2) This allows for a variety of optimisations now that we do not have to
constantly wait for a potential default value hidden in the storage.
This is why this commit also introduces a way for the search panel model
extension to sometimes return its query informations sooner than after
being completely loaded.

Task 2284207
2020-08-04 12:46:27 +00:00
35b4b6b745 [FIX] web: Close dialog when clicking button with close attribute
In a dialog, a button with `close="1"` should close the dialog when clicked.
It currently only works if the dialog is a subview.

closes odoo/odoo#55200

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: fleodoo <fle@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2020-07-30 13:45:07 +00:00
Aaron Bohy b4ba0fc340 [FIX] *: adapt tests to env rework
This commit adapts tests following recent changes on the helpers.
The main change is that addMockEnvironment (and all functions using
it) are now async, as they need to wait for services to be started.
2020-06-12 09:47:48 +00:00
Lucas Lefèvre 997d21a67e [IMP] web: Allow to use a custom control panel
The abilty to use a custom control panel for an action
seems to have been lost with 18e5416.

With this commit the action config can specify a custom
component to use as control panel.

Usefull for o-spreadsheet integration.

Task 2238915

closes odoo/odoo#52807

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2020-06-11 07:41:02 +00:00
Samuel Degueldre f5e0727ca5 [FIX] web, *: fix keyboard overlay staying active when alt-tab/clicking
*: website

The keyboard navigation mixin was initially only used in the web-client,
because of this, some of the logic for hiding the overlay was put inside
of the web-client. We recently made keyboard navigation available on
website [1]. The handlers that would hide the overlay when alt-tabbing
or clicking on the page were not registered. This commit fixes that by
making the keyboard navigation mixin register the overlay-hiding
handlers itself.

[1]: https://github.com/odoo/odoo/commit/0b0690a3934cedcab0d5e34373e8d40c2ab25660

closes odoo/odoo#50122

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-05-25 08:41:49 +00:00
Julien Mougenot 85eef1ec4d [FIX] web: properly define control panel layout
Before this commit, some elements in the control panel were not properly encapsulated
in layout-related parent elements and this caused some inconsistencies if some of
the control panel components were not displayed. For example: if the breadrumbs
were missing, the search bar went to the left side instead of the right.

Now, all components are in a grid-like structure (in desktop mode) and should not
overstep their given boundaries. The layout in mobile remains unchanged since the
top part behaves quite differently.

closes odoo/odoo#50057

X-original-commit: 533db5991a5bb871198485cd71a63f75a8c6becf
Related: odoo/enterprise#10148
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-04-23 10:32:25 +00:00
Julien Castiaux ab4000fb3c [REF] base: Remove deprecated exceptions and osv
TL;DR: remember `osv` and `except_orm` ? You can forget about them.

* Deprecated `except_orm` dropped.
* `UserError` elevated as super type of all user-related
  errors.
* Unused `DeferredException` dropped.
* Unused `QWebException` dropped (real one is in `qweb.py`).
* `MailDeliveryException` made a python exception.
* `name` legacy exception attribute made an alias of the python standard
  `args[0]` attribute and deprecated.
* `value` legacy exception attribute dropped.
* `exception_type` RPC error response key dropped.
* Deprecated `osv` module dropped.
* `--osv-memory-age-limit` cli option made an alias of
  `--transient-age-limit` and deprecated.

The `odoo.exceptions.Warning` have long been a deprecated alias to
`UserError`. It is going to be removed in a future version but first we
explicitly deprecate it with a warning.

The `odoo.exceptions.DeferredException` was a very old internal
exception, it has been removed without deprecation notice as it is never
raised.

The `odoo.exceptions.except_orm` has been a deprecated exception type
with deprecation warning for 5 years, it has been removed in favor of
UserError which becomes the super class of all user-related errors.

The `odoo.base.models.ir_mail_server.MailDeliveryException` was
inheriting `except_orm`. As it is not related to a user error but is
more of a problem an admin much take care of, the exception has been
made a Python error.

The `exception_type` JSON key in RPC error responses was holding an
hardcoded value derived from the exception type. Its usage has been
dropped in favor of the `name` JSON key that holds the precise exception
name. Again as it was hardly used in the source code (beside the crash
manager) it has been dropped without deprecation warning.

Since we are here trying to clean odoo custom exceptions, we are also
deprecating the `name` exception attribute in favor of the more standard
`args[0]` attribute.

The `name` (along with `value`) were two attributes used to raise
`except_orm` exceptions before the introduction of `UserError`,
`AccessError` and related exceptions. The `name` attribute, at the time,
was holding the exception type/title. Nowadays it contains the error
message. The `value` attribute, at the time, was holding the error
message. Nowadays it is no more used.

The `osv` module contains very old deprecated aliases. There is no
simple way to log a deprecation warning for osv, osv_memory and
osv_abstract but as they have not been in use for ages, they have been
removed too. To be consistent, the `--osv-memory-age-limit` cli option
has been made a deprecated alias to the `--transient-age-limit`.

closes odoo/odoo#45723

Task: 2187728
Related: odoo/enterprise#9162
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-08 08:41:17 +00:00
Lucas Lefèvreandaab-odoo 1248292630 [FIX] web,*: Remove undefined domain in action menu context
*google_drive

Go to a user form view and click on "Change Password" in the action
menus.
=> traceback `Cannot read property 'constructor' of undefined`

This error is raised because `active_domain: undefined` is in the context
and py_eval can't handle an undefined value.

closes odoo/odoo#48915

X-original-commit: 69694c627be42e3d068e48be14026493628a3a8d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2020-04-02 21:06:25 +00:00
Aaron Bohy f79f9c5133 [FIX] web: report client action: mount control panel
Before this commit, the 'mounted' hook of the control panel in the
report client action was never called, because of a missing call
to '_super'. As a consequence, the 'Print' button wasn't displayed.

closes odoo/odoo#47940

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-03-18 16:07:16 +00:00
Julien MougenotandMathieu Duckerts-Antoine 804507ef49 [REF] *: Adapt all module tests to the new control panel
Use of the new control panel helpers to increase consistency and change the assertions
according to the new DOM/behaviour (e.g. components removed instead of turning invisible).

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 14:08:33 +00:00
Julien MougenotandMathieu Duckerts-Antoine 72f1633532 [REF] web: Move control panel mobile to enterprise
Now that mobile is not supported anymore in community, the mobile layout of the
control panel has been entirely moved to enterprise. This caused some conflicts
with the community mobile test suite (which does not make sense anyway). The failing
tests and related style sheets have been moved as well.

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 09:37:30 +00:00
Romain Estievenart 8ec70c9072 [FIX] web: data-mobile on action_manager_act_window
Commit ca4eaf4 introduced the data-mobile attribute, used
to specify options to pass when executing an action, only in
mobile (like using a fullscreen modal).

However, we forgot to add the 'isMobile' check, so the option
was passed in desktop as well.

This commit fixes the issue and adds some tests.

Task ID: 2155601

closes odoo/odoo#47333

X-original-commit: 6cb68a53106fa7326a7f818461418437d5a0df77
Signed-off-by: res-odoo <res-odoo@users.noreply.github.com>
2020-03-10 21:40:19 +00:00
Lucas Lefèvre b7d1db596b [FIX] web: Call on_attach_callback on systray widgets
Currently, the method `on_attach_callback` is never called on any Widget in the
systray.

Calling `on_attach_callback` is required if any systray widget uses an OWL
component via the ComponentWrapper. Without the callback, the component is never
considered mounted to the DOM and no event handler is triggered.

closes odoo/odoo#46566

Related: odoo/enterprise#8887
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-03 11:01:03 +00:00
Damien Bouvy 8f0d1f1462 [IMP] web: allow custom state in action mixin
Sometimes, it might be useful for an action (e.g. a client action,
although this may be used by standard views as well) to include custom
values in its state. Since the state of a 'fullscreen' action is pushed
in the URL, this means that it is possible for the action to resume its
state properly upon refresh of the page (before this commit, only some
standard information were pushed to the state - action_id, menu_id, etc.
for window actions and action's name, active_id, active_ids for client
actions).

By implementing the `getState` method, an extension of the action mixin
can thus push any state it wishes to the URL.

closes odoo/odoo#39529

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-10-31 11:26:44 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Xavier-Do d65fcfecb6 [FIX] web: avoid expensive 404 during js tests
A 404 will take 3 to 5 seconds to be resolved and execute +- 1900 query, to return
a rendered page which is quite expensive, especially when multiple missing images
are rendered in a view.

Catching static route and marking them as not frontend will help to avoid to handle miss
on static resources. In this case server returns a standard 404.

This commit also fix a iframe src in order to avoid a 404 on
/web/(test )/report/html/some_report (thx to aab-odoo)

X-original-commit: 818d0cb59fbae78d0edf06318082981f318e4db7
2019-10-17 17:10:06 +00:00
Romeo Fragomeli 547d2d87fc [FIX] web: not possible to show a notification via client action
Before this commit, it was not possible to show a message using a client
action. (e.g. show a success message only with core in Python)

Now, it's possible using a client action. This client action call
displayNotification and so we can use the same options also.

A test is added to be sure that this action do not change the current action

Note: in the future a custom registry may be created in a refactoring
to specific function action registry.

X-original-commit: 8775fd670b6b3ec19a77fc0eab72d2223baa36c8
2019-10-14 12:11:23 +00:00
Romain Derie 9bbf57f915 [REM] web: remove unused controller /apps/<app>
This controller never really worked in the last 3 versions.
It was fixed in 11.3 with e9350993ca but broken with refactoring in 12.0 at a
higher level with 19eacf7d23.

It was even worse in 13.0 as it was leading to a traceback: `view_type` field
got removed with 3cd7ed07a2 but this controller was still reading that
field.

closes odoo/odoo#38355

X-original-commit: a5c4e262449fef03d05d5250e4523832db5fbf00
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-10 08:56:22 +00:00
Christophe Simonis f1c0b08504 [MERGE] forward port branch saas-12.4 up to bef26222b8 2019-09-25 16:53:26 +02:00
Christophe Simonis 257a382b5c [MERGE] forward port branch saas-12.3 up to dd627b9698 2019-09-25 13:43:26 +02:00
a7a60f7c61 [FIX] web: avoid multiple displays of the "same" discard warning
Before this commit, editing a record e.g. in a form
view and toggling the home menu would cause the discard
warning to be displayed twice when going to the home
menu (in enterprise) and then once again when going to
an other app. This is now fixed.

Task ID: 2043027

closes odoo/odoo#37301

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2019-09-24 08:34:43 +00:00
Aaron Bohy 127be68cca [FIX] web: do not disable searchpanel on button clicked
Before this rev., the searchpanel was automatically disabled (not
present) in actions obtained by following links or buttons (e.g.
stat buttons).

This rev. removes this constraint, but adds the possibiliy to
disable it by setting key 'search_panel' to false in the context.

Note that in this case, the active categories are never retrieved
from the local storage (i.e. the last one set). If no default is
given, 'All' is simply selected (no domain).

Task 2069310
2019-09-16 07:29:43 +00:00
Mohammed Shekha 6952ee18bc [FIX] web: crashmanager wrong syntax of arrow function
arrow function used for error handler and error function is defined
inside inner function so this will get changed, need to use self,
also arrow function doesn't have its own arguments object,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Issue raised from following commit:
https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab

task-2052484

closes odoo/odoo#35788

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-27 12:13:43 +00:00
Christophe Simonis bfd34e14b1 [MERGE] forward port branch saas-12.3 up to 40e8b67179 2019-07-26 15:12:29 +02:00
Martin Trigaux a98427834e [MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c2
closes odoo/odoo#35119

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-24 10:32:23 +00:00
Aaron Bohy 04a600486e [FIX] web: remove lazyloaded controller from stack
... if the current action can't be executed.

Let's assume a form view for a record with a multicompany ir.rule.
If the user switches to another company, the webclient is reloaded,
but he doesn't have access to that record anymore. In this case,
he is redirected to the Home menu.

Before this rev., when he clicked on an app in this situation, it
crashed. This was due to a leftover reference of the failed action
(the lazyloaded, multi-record controller) in the controller stack.

closes odoo/odoo#34994

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-19 12:07:56 +00:00
Martin Trigaux aadc4a9f0b [MERGE] Forward port of saas-12.3 to saas-12.4 up to fe4caecb59
closes odoo/odoo#35059

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-22 10:05:49 +00:00
Aaron Bohy e0c7c8e288 [FIX] web: execute action from new record and go back
Let's assume a form view with a readonly many2one field with a
default value. When creating a new record, the user can click on
the many2one value, which should open the related record in a form
view (stacked in the breadcrumbs).

Before this rev., this didn't work: we actually came back to the
previous view/action in the breadcrumbs, when trying to open the
related record.

closes odoo/odoo#33172

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-18 09:48:07 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Christophe Simonis 76275c2c12 [FIX] web: correct forward-port of e9350993ca 2019-06-04 16:27:42 +00:00
Christophe Simonis c8d7ad9a6b [MERGE] forward port branch saas-12.2 up to 995aa1685e 2019-06-03 15:49:31 +02:00
Christophe Simonis cfe0523714 [MERGE] forward port branch 12.0 up to 8f21148e1a 2019-05-31 14:37:38 +02:00
David Monjoie 88a26235ca [IMP] web: add optional fields parameter
This commit adds a new parameter on fields for list view and one2many.
The parameter name is "optional" and its values are "hide" or "show".

Columns of the list view which have the optional parameter set are
listed in a dropdown that can be toggled from the last cell of the
table header. The ones with optional set to "hide" are hidden by
default.

User choice is stored in local storage. If no saved parameter can be
found in local storage then the default value from the view is used.

Due to the overflow behavior of the responsive table, we were forced
to wrap the table-responsive div in yet another div. We changed the
o_list_view class on the table to o_list_table in order to reuse
the more generic o_list_view class on the top-most div. CSS rules
and selectors had to be updated according to this change.

Task-1902765
2019-06-04 07:04:50 +00:00
Christophe Simonis 8d7ee39213 [MERGE] forward port branch saas-11.3 up to 8a0e819d0b 2019-05-29 14:06:12 +02:00
Romain Derie e9350993ca [FIX] web: restore /apps/<app> controller
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.

closes odoo/odoo#33679

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-27 11:44:08 +00:00
Christophe Simonis d5e1fd16b4 [MERGE] forward port branch saas-12.4 up to cda4f3c308 2019-07-29 14:10:30 +02:00
Martin Trigaux 5a6a414e2c [MERGE] Forward port of saas-12.4 to master up to aadc4a9f0b 2019-07-22 14:47:52 +02:00
Lucas Perais (lpe)andAaron Bohy dd7022eccd [IMP] base,web*: searchpanel in all multi record views
Before this rev. the searchpanel could only be activated in kanban
views (and it was specified in the kanban arch). From now on, the
searchpanel can be activated in any multi record view. It's arch
is moved to the search view arch (inside the <searchpanel> tag).

Task 1985921

Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-07-19 08:39:07 +00:00
Aaron Bohy ea2207afea [FIX] web: don't close dialog on doAction with target 'new'
Rev. ee44d23 fixed a usability issue: when a doAction is performed
from a dialog, it automatically closes the dialog (as the action is
rendered in the background, behind the dialog).

However, it also closes dialogs when the action has target='new',
i.e. when it also opens in a dialog, which is not strictly
necessary in this case.

This is problematic in mobile for the product configurator widget:
in the sale.order form view, the order_line field is displayed as a
kanban, and in its form view, the product_(template_)id field has
widget product_configurator. When a value is set, it performs a
doAction (target="new") to configure the product. The widget listens
to the dialog's 'closed' event to update itself. However, with what
is done in ee44d23, the x2many form dialog is closed by the DoAction,
so the flow doesn't work.

This rev. reverts the attempt done in ee44d23, and does something a
bit more brutal: as soon as an action is pushed in target 'current'
(in the main part of the interface), all dialogs are automatically
closed.

closes odoo/odoo#34678

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-07-09 07:59:05 +00:00
Priyanka Kakadiya 7194168457 [FIX] web: fixed default order issue
In a list/kanban view when applying a default_order on the view, it does not
work with favourite filter

Before this commit,
1) The default_order was not applied to the view when favourite filter is
applied
2) when default_order applied, Click on an element of the list/kanban and
then go back to the list/kanban with the breadcrumbs, default_order has been
changed.

This is because the ```_getOrderedBy ``` returns [] when favourite filter is
applied and it does not have sort value, added check if favourite has orderedBy
and has length then and only then pass orderedBy else pass undefined

After this commit,
1) default_order will be applied to the view
2) default_order will not be changed when going back through breadcrumbs

task-1922576

closes odoo/odoo#34001

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-07-02 06:55:34 +00:00