Commit Graph
10701 Commits
Author SHA1 Message Date
Aaron Bohy 7c7b478220 [FIX] web: list: do not call on_attach_callback at reload
Before this commit, the ListRenderer's on_attach_callback hook was
called each time the view was reloaded, even though the renderer
was already in the DOM. As a consequence, sub components were
mounted several times, which could lead to issues.

For instance, go to Inventory > Operations > Transfers, create a
new one. Change the Operation Type to a Receipt, and change again
to a Delivery: it crashed.

Task 2315149
Closes #56701

closes odoo/odoo#57101

X-original-commit: 78f361fb5382e4c7aed9a4e705e20f8d8757300d
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-04 13:40:44 +00:00
Aaron Bohy 56be6fa612 [FIX] web: form: Archive action when field not in view
Before this commit, when being in a form view without active field
(the field is defined on the model, but not present in the view),
the action "Unarchive" was available in the Actions menu, even
though the record was actually active.

The issue has been introduced by [1]. This commit restores the
previous behavior: when the active field isn't in the view, the
Archive/Unarchive action isn't available in the Actions menu.

[1] 220eb4db39

closes odoo/odoo#57041

X-original-commit: 97b70aab69b491443d862847fbff69c4e29274af
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-03 14:22:23 +00:00
Simon Genin (ges) 618067aa3f [IMP] base: Document layout preview improvements
The document layout preview is a complete defferent simplified template
with its own css that replicates at best the different styles.
It does not have the external layout features and lack of fidelity.

The new preview actually use the real documents templates and put the
result in an iframe. It now has a high fidelity, though not perfect.

The goal is for a better onboarding, where clients see easely how
documents will look if they had an app to generate them. Of course, the
data on the document is a false invoice.

Refactor all this from base to web.

Task ID 2304177

closes odoo/odoo#56995

X-original-commit: c121a246f16899735306266a3a12b526e08e7620
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-09-03 08:44:35 +00:00
Adrien Dieudonne 4a8ff2ab2c [FIX] web: preview PDF file on iOS
Before this commit, the end users were unable to click on the
kanban image to see document's preview.

To fix this we removed lines from a previous fix which is no
longer useful in 13.0 because we now use kanban views for
many2X fields instead of list views.
See original commit:
https://github.com/odoo/odoo/commit/26c62cbb4401bffb72ce77fee481ca84b77a8143
So for mobile phones it's working fine.

For iPads, this rule is no longuer necessary since iPadOS.
See "Accelerated Scrolling on iOS and iPadOS":
https://webkit.org/blog/9674/new-webkit-features-in-safari-13/
For previous versions it still works because the DOM has changed.

Steps to reproduce:
- Go to Document
- Click on "o_kanban_image"
=> Your're stuck on a grayed page.

opw-2260101

closes odoo/odoo#56977

X-original-commit: 0d41d0daa7220a791bc4df85cca4100e3634e432
Related: odoo/enterprise#12907
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-09-02 16:24:13 +00:00
Victor Feyens 1aa874aab3 [IMP] web: new widget for static image urls in char fields
This new widget allows definition of Images through static urls stored in a Char field.
It was implemented to provide a way to reduce databases footprint by using
static files instead of duplicating them in the databases (& their backups).
2020-09-02 13:57:23 +00:00
Sébastien Theys f5cdc6414c [FIX] web: fix style of form view in modal
task-2302721

closes odoo/odoo#56934

X-original-commit: 7c4787a1431538ddb69bfbc50a27dd033437a6a4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-02 10:58:10 +00:00
Mohammed Shekha 75f6dcb8b1 [FIX] web: do not display nocontent help if empty
Have an action which help field has the value:
```
<p></p>
```
Display an empty list or kanban

Before this commit, the nocontent helper was displayed even though there was
nothing to display.

After this commit, an empty html tag is the same as an empty string,
so the helper is not displayed.

task-2320318

closes odoo/odoo#56883

X-original-commit: 3d6bdc5b01a4a94de9baa9bae230e6b34f38dbc9
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-09-01 12:14:05 +00:00
Kamesh Patel 0e8d2f4f15 [FIX] web: emptylist helper position
Before this commit:

An empty list helper position not centered when search panel sidebar is
there and some issue created while having a droplet on it as the
position will shifting after a few seconds (sign_tour)

After this commit:

Set an empty list helper at a relative position and now it will always be
displayed at the center whenever have a search panel sidebar

LINKS

Task-2323988

closes odoo/odoo#56792

X-original-commit: d50c7f5c88eaef56c757849a64d63f92bd73f2f2
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-31 11:14:27 +00:00
Pierre Collinet (pic) 26ada8aea0 [IMP]hr_recruitment: adjustments for the onboarding tour
- reduce the size of the tooltip box when the tip is short
- display the rainbow message longer on the screen to allow
the user to read it.

closes odoo/odoo#56562

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-26 09:23:18 +00:00
Cocographiqueandqsm-odoo 9ee35cf23e [IMP] website, *: add style options for navbar links
*: web

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 3f7e2949aef56d66b46417206b539f5ca74a1aae
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-28 08:19:35 +00:00
stefanorigano (SRI)andqsm-odoo a65407b9c3 [IMP] website, *: add off-canvas and other hamburger menu options
*: web, portal

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 89bf0d4170f42b40cd46915c7d0160c4818f3b8f
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-28 08:19:35 +00:00
qsm-odoo e1beebebef [FIX] web: make BS more robust with customized input groups
For some strange reason, BS is handling small and large input groups
pretty well but not normal ones. Indeed when customizing the paddings
of buttons and inputs individually, the normal-size input groups are
broken. Also, customizing the border width of buttons always breaks
input groups for all sizes. This is now fixed.

Note: the first problem was actually already solved by increasing the
input height to the button height. It makes actually more sense to
shrink the button size to the input height as this commit does (as this
is the input which is the main element in an input group).

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 7786d27bb42f1846442e37b7b2cba4a7c25131fb
2020-08-28 08:19:31 +00:00
qsm-odoo 3ee78f1523 [FIX] web: implement more complete menu autohiding feature
The code in charge of adding inside a dropdown the menu items that would
be forced on a second line was not doing it properly when there were
some display: none items and especially not when there were neighbours
using the m*-*-auto classes.

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 87a90f6816c0ce3db7d9d2edbe1b5149fd7bacff
2020-08-28 08:19:30 +00:00
Mohammed Shekha e89423b2a6 [FIX] web: ribbon in form doesn't overlap kanban state
Have a project.task that is archived
Display it in form view and with the chatter on the side (big screen)
(though the issue happens at any viewport size, with slight difference is positioning)

Before this commit, the field kanban_state is under the ribbon, with no way
to interact with it.
It could happen with the title itself, or with any field that we'd put
on the right side of the form.

After this commit, the kanban_state field is visible.
In short, siblings of the ribbon now have some right margin in css.

task-2226237

closes odoo/odoo#56579

X-original-commit: d701317a6c3ba002e935f8b30ce160cc186c239a
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-26 11:40:57 +00:00
Mohammed Shekha 954fd0e75e [IMP] web: do not resize quick create form on window resize
The quick create form view is explicitly given the o_xxs_form_view
class at initialization but resizing the window sometimes changes that
class on form element in enterprise.
To avoid this in the quick create case, the method _applyFormSizeClass
has been overriden in QuickCreateFormRenderer in order to do nothing
when the window is resized, so that the class and the related style stay
the same as expected.

Task ID: 2317807

closes odoo/odoo#56521

X-original-commit: f9c605ea578267de17e6c1dcc69dfd179d5d95fe
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-25 13:45:01 +00:00
Hardik PrajapatiandMohammed Shekha 9879f738f5 [FIX] web: open list optional fields dropdown position to right place
before this commit,
when there are too many fields on list view and list view has horizontal scroll
opening optional dropdown does not open on right place, instead it opens bit
left side from the right.

this commit fixes the issue by appending dropdown div inside table element, as
scrollbar comes inside table element, so appending dropdown element inside
table just after dropdown toggler.

task-2307248

closes odoo/odoo#56516

X-original-commit: 5a044593ba1f8f08f72de502d77823a8dd5175a0
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-08-25 13:02:29 +00:00
Carlos Valverde (cvs) 36f716b866 [IMP] web: calendar inline fix
When visiting the Month view of the Calendar App, events titles and 
time will be displayed inline, showing first the time of the event and
then, the event title, truncated when needed, at the right of the 
container.

Task 2200233

closes odoo/odoo#46078

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-25 08:22:58 +00:00
Dhruv Patel 1a72307bd2 [FIX] web: misalignment in o_colorpicker for "Hide in Kanban" label
In o_colorpicker popup, the "Hide in Kanban" checkbox label is not
aligned with the checkbox.
With this commit, we have aligned the label with the checkbox.

Task ID: 2277254

closes odoo/odoo#56447

X-original-commit: 72252ff8a6aaae86fae121a7006039a40ba6efe2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-24 16:42:21 +00:00
Damien Bouvy be9ea60d07 [IMP] web: support custom create_name_field in calendar view
Until now, the quick creation dialog of the calendar view assumed that
the underlying model used a 'name' field for quick creation, with a
graceful degradation if it was not the case (redirect to the form view).

This prevented quick creation of models created through customizations
(for example).

This commit adds a `create_name_field` attribute on the view declaration
(similarly to many2one field) that allows to specify the field to use
during quick creation.

Task-2185423

closes odoo/odoo#48122

Related: odoo/enterprise#11242
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-08-24 11:50:15 +00:00
Lucas Perais (lpe) 59c8c523de [FIX] web: crash_manager uses BrowserDetection
Before this commit, the crash manager used a copy of the browser detection isBrowserChrome method
because it was not possible to to register the proper dependency in stable version

This commit makes the crash manager use the module BrowserDetection for that purpose, with the proper
registered dependency before hand

closes odoo/odoo#56364

X-original-commit: 59e0dbab98466a23792af4a10003142614bda676
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-24 07:30:42 +00:00
1ca3a590f7 [FIX] web: crash manager correctly formats error message in Firefox
Have a piece of code that throws an Error

In browsers not powered by V8, the stack trace won't be formatted and the Error
type won't appear in the crash manager modal report.

This happens because Error.prototype.stack is non-standard, although most
browsers have an implementation of it. Chrome for example automatically formats
the Error.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
https://v8.dev/docs/stack-trace-api\#compatibility

After this commit, the Error is formatted in the crash manager report, the same
way as Chrome does it.

task-2191727

closes odoo/odoo#56318

X-original-commit: dbf670f2e0ec797aeaf998aa28b32afbdd2c3b4c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Hardik Prajapati <hap@odoo.com>
2020-08-21 14:33:45 +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
Dhruv Patel 91b737d3c0 [FIX] web: start typing text in dropdown not showing on hover
When you hover on the "Start Typing" text in autocomplete dropdown,
it will not visible as its CSS overwrite with the rule and change the text color
as white.

With this commit, we have added the css rule for specifically "Start typing"
dropdown item and its looks consistent as other dropdown items.

Task : 2311983

closes odoo/odoo#56233

X-original-commit: ee8739361830981539127b269363a6fcbfcd840c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-20 14:18:02 +00:00
ce69db55f8 [IMP] web: set focus to first visible page when active page invisible
Before this commit: if there are modifiers based on field which hides
one page and show another and if active page get invisible then instead
of first page second page gets focus, consider following example,

`<form>
    <field name="boolean"/>
    <page name="page1" attrs='{"invisible": [["bar", "=", false]]}'></page>
    <page name="page2" attrs='{"invisible": [["bar", "=", true]]}'></page>
    <page name="page3"></page>
</form>`

Consider the initial boolean value to be true; initially the first page
will be visible. But when "bar" is unchecked then page1 will be hidden
and page3 will get the focus as page2 is still not visible: it will be
after the computaion/application of all modifiers, which is currently
done after the rendering of a tab page.

Now: the first visible tab is focused on rendering (same as before) but
also after all modifiers have been updated.

closes odoo/odoo#56209

X-original-commit: 10365572aa3629e9b19d2b29726b351275de9f52
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Ipsita Borisagar <ibo@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-08-20 12:37:36 +00:00
Jeremy Kersten 8fb2ac4e65 [IMP] web: add a size_changed bus event
This commit will add a bus in the web.config config that allows
to trigger events.

The first use case is the trigger of the size_changed event that
is triggered each time the size of the screen changed of bootstrap
breakpoint.

task-2276740
PR #53175
2020-08-18 17:40:16 +00:00
Julien Mougenot 7be346d637 [IMP] web: Improve kanban quick create keynav
The "quick create" form now renders the kanban quick_create buttons on
its own. This means that the form handles them as regular form buttons,
hence including them in its keyboard navigation.

Part of task: 2314864

closes odoo/odoo#55787

Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2020-08-18 14:22:09 +00:00
Jérémy Hennecart 2c21301d31 [IMP] web: manage invisible fields in graph and pivot view
PURPOSE

Be able to remove some measures from graph / pivot views. Currently fields
are automatically added but some of them make no sense.

SPECIFICATIONS

Add the possibility to not display some fields in the measures dropdown for
the graph and pivot views.

When a field is not displayed in the measures of a pivot views we remove them
also from the list of groupable fields.

LINKS

Task ID-2288381
Community PR #54774
Enterprise PR odoo/enterprise#11970
Upgrade PR odoo/upgrade#1519
2020-08-18 08:56:48 +00:00
bb9ef00452 [IMP] web: support action helper on gantt view
Currently, only List and Kanban view supports the action helper and
display the folder icon with the helper text.

With this commit we have also provided the action helper support for
other views. The logic for no content helper has been moved in
abstract_renderer.js so that it can be accessed by all views. This was
done mainly to give the action helper to the gantt view.

closes odoo/odoo#53902

Task: 2284779
Related: odoo/enterprise#11563
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-08-14 13:12:07 +00:00
Harpritsinh SisodiyaandMohammed Shekha 88608c605f [IMP] web: kanban: archive last column records
Before this commit, the action helper (if any) was not displayed when
archiving all records of the last non empty column of a kanban view
(making empty that view).

With the present commit, the action helper is now correctly displayed in
that situation.

Task ID: 2247788

closes odoo/odoo#50557

Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-08-17 13:21:16 +00:00
Olivier Dony 61c21213b2 [IMP] web: allow password fields to force the autocomplete value
Follow-up on 6edb749534, where default
`autocomplete` values were introduced as default for password fields,
according to the new autofill specs.

This patch allows developers to force the "autocomplete" attribute value
on password fields, in case there really is a need for a value that is
not `new-password` (which BTW now triggers the password generator wizard
in many browsers).

It is useful for example when a backend form really needs to ask the
user for their current password, so the correct `autocomplete`
value is `current-password`, as on the login form.
2020-08-14 23:06:24 +00:00
stefanorigano (SRI)andqsm-odoo fdbcf87228 [IMP] web, web_editor: review colorpicker design
Part of https://github.com/odoo/odoo/pull/55959
task-2157252

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 19:19:47 +00:00
Nicolas LempereurandMathieu Duckerts-Antoine 7cf8f6f40e [FIX] web: pivot non-persistant on null value
In pivot view, a cell data is determined by his row/column key which
are the value chain of field values to get to that row/column.

If you had a grouping with value in a cell and then close the grouping,
you could somehow get the old value back wrongly on next grouping
operations.

This happened because:

- the key was computed based on the value (eg. for relational field the
  record ID) but without the field name.

- succeeding read_group only fill existing values.

eg. If on pivot view we had a salesperson with same ID as product
category, if we closed salesperson grouping then opened product
category grouping, we could possibly get the cell value to the product
category that has the same ID as the salesperson.

With this changeset, we clear the cell data corresponding to a grouping
that has been closed.

Added test without the fix would fail by displaying data of a previous
read_group that should have been cleared inbetween.

opw-2262306
closes #55129

closes odoo/odoo#55936

X-original-commit: f1df73adca4955561814d4b8e90a62d7d50c1c33
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-14 12:31:50 +00:00
Mathieu Duckerts-AntoineandAaron Bohy 3da3ae1178 [FIX] web: pivot: avoid to toggle invalid measure
Before this commit, click on the divider in the menu 'Measures' of the
pivot control panel would cause a crash. The present commit fixes that
situation.
We also bring another small correction: the menu won't close if one
clicks on the measure list but not exactly on a menu item or the
divider.

closes odoo/odoo#55902

X-original-commit: aad9f3fd7499ef8b660cc25fea840a34d70f75a6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-14 07:52:49 +00:00
Julien Mougenot d9bbf1db4b [FIX] web: Prevent field badge from overflowing
Before this commit, the field badge could overflow from its boundaries
and have part of its pill/text hidden.

Now, the "overflow" mixin has been applied and the badge is properly
contained.

closes odoo/odoo#55806

X-original-commit: f4b672bfcf21c7c7f0b6071a8dd18bd6e966266b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-08-12 11:40:29 +00:00
Mathieu Duckerts-AntoineandAaron Bohy ae0d79f5c2 [IMP] web: sample data in dashboard view
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes in
community to have sample data in dashboard views.

Task ID: 2282196

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-12 08:52:20 +00:00
Aaron BohyandMathieu Duckerts-Antoine e219aac56a [IMP] web: sample data in pivot view
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in pivot views.

Task ID: 2282196

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-12 08:52:20 +00:00
Mathieu Duckerts-AntoineandAaron Bohy ae58021255 [IMP] web: sample data in graph view
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in graph views.

Task ID: 2282196

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-12 08:52:20 +00:00
Mathieu Duckerts-AntoineandAaron Bohy fd6182443f [IMP] web: sample data in reporting views (preparatory work)
The present commit brings the global changes necessary to have sample
data in the reporting views. This includes several modifications/
fixes of the sample server (many of them for better visual results).

Task ID: 2282196

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-12 08:52:20 +00:00
Aaron Bohy 06b8af3212 [REF] web,purchase: SampleServer: mock registry
This commit changes the API of the SampleServer's mock
registry s.t. one can register a mocked version of a method,
whatever the model. The former API required a specific
model to be specified, and only applied on this model.

However, in order to enable the sample data feature on the
cohort view, the 'get_cohort_data' method needs to be
mocked, whatever the concerned model.

One can now register mocked methods for a specific
model only (with key 'model/method') or for every
models (with key 'method').

Task ID: 2282196
2020-08-12 08:52:20 +00:00
Aaron Bohy f3ee2e0cec [IMP] web: no content helper style for sample mode
Task ID: 2282196
2020-08-12 08:52:20 +00:00
Aaron Bohy d0bf6192d2 [IMP] web: sample data: generate better activities
The SampleServer picks a random value for selection fields. As a
consequence, field 'activity_exception_decoration' is always set,
either to 'warning' or 'danger'. When this field is set, widget
'ListActivity' (set on 'activity_ids') displays 'Warning', whatever
the value of 'activity_ids'. This means that with sample data, the
next activity field always displays "Warning", which is not great.

This special case has been handled in web, as it is the first (and
only) one. In the future, if we have to implement several special
cases like that, we'll setup a proper hook to allow external
modules to define them from the outside.

Task 2316726

closes odoo/odoo#55703

Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2020-08-12 10:07:32 +00:00
Julien Mougenot c00e76b67c [FIX] web: Filter with domain disables category counters
Before this commit, the search panel was subject to some inconsistencies
when dealing with a category having enabled counters and with a filter
defining a "domain" attribute. Indeed, the counters could be in an
incorrect state if the right filters/categories were not loaded first,
with no simple way in doing so.

The search panel being complex enough as it is, we decided to disable
all categories' counters in the presence of a filter having a "domain"
attribute regardless of said domain.

closes odoo/odoo#55734

X-original-commit: e78f777bd8ccb314b85451cbc8d1dd9109997d7a
Related: odoo/enterprise#12341
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-08-11 10:12:15 +00:00
Michael Mattiello (mcm) a5cca2cda3 [IMP] web: add smart date input on date field
This commit adds smart date inputs for date and datetime fields.

The goal of smart date input is to provide the user some shortcuts
when setting dates.

The rule is [+-]\d+[dwmy]?
So we can enter inputs like:
  +3  to have today + 3 days
  -2w to have today - 2 weeks
  +1y to have today + 1 year
  +5m to have today + 5 months
  -4d to have today - 4 days

closes odoo/odoo#55602

Task: 2270347
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-08-11 14:15:43 +00:00
xO-Tx c697da9403 [FIX] web: make emoji dropdown appear on top of content
Form sheet with hidden overflow (added to improve ribbon widget css) prevents
emoji button from showing emoji list when clicked. This commit attempts to
show the complete emoji dropdown by removing overflow from the sheet container.

IMPORTANT : This override won't affect ribbon since the hidden overflow was
added on the widget itself.

Task ID-2224393
PR #49096
2020-08-11 14:38:33 +00:00
Michael Mattiello (mcm) 0f4acfa13f [IMP] web: remove popup on click
This commit adds a event listener on window to close
calendar popup when click anywhere outside this popup.

Task: 2193921
2020-08-11 12:32:54 +00:00
Michael Mattiello (mcm) 1e11249c93 [IMP] base,web: add scales param to calendar
This commit adds the parameter `scales` in the calendar view's template.
This parameter can be used to choose which mode(s) is/are allowed.

This commit also refactors the way we manage calendar scales.
Before scales were defined in model and renderer, now it's defined
in the view and given to model, controller and renderer by params.

Task: 2193921
2020-08-11 12:32:54 +00:00
Michael Mattiello (mcm) 1fc33a63be [REF] web: rework calendar's style
This commit reworks the mini calendar's style to make it look like
the months in year mode.
It also reworks the style of the calendar's popover in modes day,
week and month to reduce the differences with the year popover.

Task: 2193921
2020-08-11 12:32:54 +00:00
Michael Mattiello (mcm) 441d9f65b3 [IMP] base,web: add year scale to calendar
This commit adds a new year scale to the calendar view.
It comes with a new view in the calendar, this view displays a
4x3 grid which cells are month views.

Task: 2193921
2020-08-11 12:32:54 +00:00
Michael Mattiello (mcm) 9a53b03239 [REF] web: optimize a bit calendar view
This commit optimizes calendar view especially for year mode
- remove/add events has replaced by an event source and refetch.
- do not re-render events when navigating date

Task: 2193921
2020-08-11 08:46:45 +00:00
Yannick Tivisse d2238de576 [IMP] hr_holidays: Improve the general usability (back2basics)
closes odoo/odoo#55568

Taskid: 2282495
Related: odoo/upgrade#1574
Related: odoo/enterprise#12272
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-11 09:10:49 +00:00