Commit Graph
455 Commits
Author SHA1 Message Date
Jorge Pinna Puissant 54e9527ec2 [IMP] web, *: read session information from a module
* google_recaptcha, mail, partner_autocomplete, point_of_sale, website

Now, to read session information, the module "@web/session" must be
imported. Not that, there is also the user service with all the user
information.

closes odoo/odoo#73201

Related: odoo/enterprise#19434
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-08 14:13:39 +00:00
Samuel Degueldre ee3804fdf5 [IMP] web: prefetch translations to speed up webclient startup
closes odoo-dev/odoo#901

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:29 +02:00
+1 0573acae23 [REF] web: rewrite the webclient in OWL (phase 1)
This commit is the first phase of the conversion of the web/ JS
codebase to the owl framework. The impact of this commit is two-fold.

First, it rewrites the framework part of web with a new system of
services and registries. Services allow to execute code (e.g. do rpcs,
setup things) before launching the application. They can also expose
an API to be used by other parts of the application (e.g. a notification
service would expose a function to display notifications). Services are
often a good extension point for external modules that want to execute
code at webclient startup. Registries offer another way to extend the
application. They provide well designed extension points to add
elements/behaviors from the outside (for instance, to add a systray item,
an error handler...).

Second, this commit initiates the conversion of the webclient to owl
with a top-down approach, around those notions of services and registries.
The root of the web application is now an owl application. Among others,
the WebClient, ActionManager, Navbar, UserMenu, DebugManager, Dialogs,
services (e.g. notification, ajax...) have been converted to the new
framework/architecture.

Legacy views and client actions are still supported (and used). They
will be converted in the next months, and at some point, the support
will be dropped.

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-06-18 21:31:27 +02:00
Younn Olivier 507408e8e1 [FIX] web, website: display default company name on frontend layout
Before, the "Company name" placeholder was hardcoded in the frontend
layout template, and the user had to change it with his company name
from the website view, which was not user-friendly if the website module
was not installed.

Now, by default, the frontend layout template displays the user's
company name. If the website module is installed, it is editable.

task-2468472

closes odoo/odoo#71176

X-original-commit: 059804be90021559debee6f930462594a3ca8a97
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-21 16:56:11 +00:00
Simon Genin (ges) ecfe85db84 [REF] web: static/src/(img|fonts) => static/(img|fonts) 2021-04-29 07:34:40 +00:00
Xavier Morel c6f744d7c3 [FIX] web: raw -> out of footer thing
Done this way so `_message` can be overridden with custom
markup. Should now work properly ootb: `final_message` should be a
`Markup` from qweb rendering, if `_message` also is such, the merge
should happen without further escaping of either value.

Note: needed to convert the str.__mod__ call to a concatenation as
otherwise the markupness information is lost. That's probably a
recurring issue.
2021-04-29 05:34:20 +00:00
Xavier Morel 996cb85c27 [FIX] *: mass replace known t-raws by t-out
* QWeb bodies should be markup-safe so `0` should always be
  markup-safe.
* `head` is qweb-rendered so the same.
* The `json` pseudo-module in qweb templates is `json.scriptsafe`,
  which should be markup-safe.
2021-04-29 05:34:20 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Julien MougenotandSimon Genin ebe86f5ca5 [REF] web,*: Flatten _assets_helpers
Before this commit, the asset bundle "_assets_helpers" was the only
bundle using a "t-raw" directive to insert assets in between other asset
calls.

Now _assets_helpers only contains the assets called before the t-raw
directive, and the second part (1 file actually) has been added after
every call of the bundle.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Aaron Bohy aa07146421 [IMP] web: boot.js: throw even if not in debug
Before this commit, when a module wasn't correctly defined (e.g.
wrong format for dependencies, wrong format for module name, name
already defined...), an error was thrown but only in debug mode.
In non debug mode, the problem was simply ignored, which is wrong.

An example of harmful consequence would be the following: if
someone defines a new test file and uses an already used module
name, he won't be notified of his mistake unless he runs the suite
in debug mode. If he doesn't, the runbot won't detect it either as
it runs tests in non debug mode. It would then lead to one of the
two test suites not being executed.

Fun fact: a lazy loaded file was actually loaded twice, but we were
only notified in debug mode. With this change, it made the test
suite fail all the time, no matter the mode. We simply removed the
file from the page source, and let the first test needing it lazy
load it.

closes odoo/odoo#66918

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-03-30 08:57:35 +00:00
yograj tandelandMohammed Shekha ef62df2bfd [IMP] web: consider FieldDependencies given on custom widget
With this commit we support adding FieldDependencies on custom widget, consider
FieldDependencies given on custom widget and add it to fieldInfo so that when
modal does calls to server to fetch data it consider those fields while reading

this will let us to design custom widget which may have some other fields in
dependency, say for example weekly recurrence widget which uses sun, mon etc.
fields, so with this we can fetch data of those dependent fields without adding
it to view.

task-2335399

closes odoo/odoo#60277

Related: odoo/upgrade#2021
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-03-26 12:25:44 +00:00
YOGRAJ TANDELandMohammed Shekha 7da9c296eb [ADD] calendar,lunch,web: weekly recurrent widget
with this commit we adding weekly recurrent widget, currently proeject and
calendar shows boolean for each day vertically but with this widget we displays
week days and its boolean horizontally.

Here widget will display first day as per language's week_start field, also we
adds FieldDependencies on custom widget and consider those FieldDependencies
while processing view node in basic_view.js

We add support of registry to contain owl custom widgets and add support
of rendering owl custom widgets.

Also with this commit we removes fields like sun, mon, tue etc. from view and
instead use "web_weekly_recurrence" custom widget to display boolean for each
week day.

Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-03-26 12:25:44 +00:00
Mohammed ShekhaandAaron Bohy 877ef5552b [IMP] web: add support of owl custom widget
add support of <widget> tag for owl, In order to prepare the future,
we want to convert everything in Owl, in future widgets generated by
<widget> tag will also be converted to owl.

with this commit we support widget to instantiate using ComponentWrapper.

task-2337692

Co-authored-by: Aaron Bohy <aab@odoo.com>
2021-03-26 12:25:44 +00:00
Oussama MESSAOUDI afce9559ac [FIX] website_forum, *: refit the forum biography popover
*: web

task-2276974

closes odoo/odoo#67902

X-original-commit: 1207b99b73f5906209499cb2935b750faecd756d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-15 19:20:48 +00:00
Michael Mattiello (mcm)andged-odoo 7086488064 [REF] web, *: remove patchMixin + imp utils.patch
* hr, hr_holidays, im_livechat, mail, snailmail, website,
  website_livechat

This commit removes `patchMixin` and improve `utils.patch`.
`utils.patch` now supports native classes and has a new parameter
used to patch class members.

`utils.patch` is now used everywhere `patchMixin` was and it must
be used to patch classes.

closes odoo/odoo#65967

Related: odoo/enterprise#16278
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: ged-odoo <ged@odoo.com>
2021-02-26 10:39:21 +00:00
Géry Debongnie e2b85d4613 [REF] web: move error handling code to other file 2021-02-25 14:30:33 +00:00
Romeo Fragomeli d85f5ddeac [FIX] web: client report action mounted called twice
Before this commit, the 'mounted' method of the ControlPanel in
the client report action  was called twice.

It happened because the client report action updated the ControlPanel
before being actually mounted, so mounted was called once when the
traceability report was mounted, and once when the update was applied.

Ideally, this should not be an issue (this isn't an issue with owl).
However, in Odoo, we mix layers of Owl Components and legacy
widgets. In these situations, the above scenario isn't properly
handled (and can't be).

As a consequence, in mobile (enterprise), it crashed because an
handler bound in mounted (thus twice) was only unbound once.

This commit avoids the issue as the update was actually useless.

Steps to reproduces (Mobile):
* Go to Inventory (Stock)
* Open the "burger menu"
* Select "Products" -> "Products"
* Select one product in the list
* Click on the "Forecasted" ("stat button")
* Select one "SO line" (sale order) to go to the form view
* Go back to the previous view using breadcrumb
* Optional: Go to another app if the screen can't scroll (e.g. go to Sales)
* Scroll the view => Bug

closes odoo/odoo#66497

X-original-commit: d3854dbf7a6e0c0f9ac00c11716908bc175808d7
Related: odoo/enterprise#16507
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-18 16:46:57 +00:00
Géry Debongnie 2716828f25 [IMP] web: display better tracebacks in debug=assets
The recent change in the way debug=assets works (which now bundles all
files in a bundle instead of serving them statically) had a negative
impact on the stacktrace displayed in the error dialog in debug=assets:
it now display the bundle/linenumber instead of the actual file/line
number.

This is not a huge deal, most of the time, because the errors displayed
in the console display the correct information, and the debugging
process should work as before.  But it can certainly be annoying in some
cases.

With this commit, we use the Stacktrace.js library to dynamically fetch
the sourcemaps and to decorate the displayed information with the
correct file and line numbers.

closes odoo/odoo#66318

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 11:52:40 +00:00
qsm-odoo 6d6ea9a530 [FIX] web: allow users to zoom on frontend pages
task-2446015

closes odoo/odoo#65536

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 13:52:03 +00:00
Damien Abeloos a96300ed1c [FIX] web: fix the RedirectWarningHandler dialog not closing
Impacted versions :
- 14.0 and higher

Steps to reproduce :
```
1. generate an odoo.exceptions.RedirectWarning
2. click on the primary button
```

Current behavior :
```
1. the action (argument of the RedirectWarning) is properly executed
2. the WarningDialog is not closed
```

Expected behavior :
```
1. the action should still be properly executed
2. the WarningDialog should be closed
```

Tests :
Added a test to ensure this behavior will not be overwritten in the future.
The test is for the CrashManager service, and evaluates the following sequence :
```
Entry: CrashManager receives a odoo.exceptions.RedirectWarning (code 200) via rpc_error
Asserts:
	- The RedirectWarning modal (WarningDialog) should be opened
	 	* Upon clicking on the primary button :
	- The modal should be closed
	- The action passed as an argument of the odoo.exceptions.RedirectWarning should be executed
```

Origin :
the incorrect behavior was introduced with :
https://github.com/odoo/odoo/commit/b3d9647695065ea582e4a6b0603f3ebf9fde6976

Task ID: 2430100

closes odoo/odoo#64553

X-original-commit: 892598cb0335926ece12789d81673f5b6370a1fd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-14 14:22:09 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
Achraf (abz) 4cc7c2bf00 [FIX] web: Load odoo script after other scripts
What are the steps to reproduce your issue ?

    1. Install website
    2. Connect on the website
    3. Choose Customize > HTML/CSS/JS Editor
    4. Choose "Web layout" (in "XML (HTML)" )
    5. Modify the HTML code by adding any <script> before the existing <script> (console.log whatever)
    6. Save
    7. Refresh

What is currently happening ?

    Traceback: TypeError: Cannot read property 'user_context' of undefined

How to fix the bug ?

    Target the odoo script by id in the xpath.

opw-2375490

closes odoo/odoo#63360

X-original-commit: 0b7ba571431d694dea7db3ba1da4c7e86d1013e5
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-15 07:04:04 +00:00
Emilien Durieu (edu) 509a530dd8 [FIX] web: allow saving copyright footer
The copyright part of the footer could be edited but not saved.
Now it can be saved.

closes odoo/odoo#62614

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-01 09:16:14 +00:00
qsm-odoo f25b0aae39 [FIX] web: preload font awesome font for frontend layouts
This commit adds an easy improvement fixing a page speed warning: the
font awesome font (declared in a font-face in assets_common) can be
preloaded.

The only problematic point was that font-awesome defines the font by
a series of URL using different font formats. Only one can be
preloaded (otherwise you would load files for no reason). As all Odoo
supported browsers use the woff2 format, we only preload that one. At
the cost of a warning for other browsers which use a different format.

task-2350647

closes odoo/odoo#60715

X-original-commit: 60c787679260a97c58f399af1a51d7549429f979
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-26 10:09:15 +00:00
Romain Estievenart e1f605bef8 [FIX] web: avoid to display dropdown outside of the screen on mobile
When opening a DropdownMenu OWL component (like the favorite menu, filter
menu) positioned to the right of the screen (left on RTL languages) on a
small screen, the content of the dropdown could easily overflow out of
the viewport, making hard to use or even unreachable.

This commit fixes it by using the middle of the screen as a threshold to
align the dropdown menu to the right (or left in RTL) of the triggering
button.

Note: this fix specifically targets mobile-like/small screens as bigger
one like on desktop would require much precise calculations (and are
not an issue at the time of this commit).

Task ID: 1879566
2020-10-21 14:45:40 +00:00
Thibault Delavallée 131cc12227 [REV] Revert "[FIX] web: add access group to the pdf js template."
This reverts commit odoo/odoo@681306d4e7.

Adding groups on assets parts is not a good idea. Indeed as assets are
compiled and optimized we do not want to serve different assets to different
users.

For example if you have several users in parallel on several workers those
could try to regenerate assets for their users. As each user has different
assets this could lead to big performance issue.

As original commit tried to solve a race condition we can safely remove the
assets fix to avoid issues and work on a cleaner solution.

See original ref odoo/odoo#51804 and odoo/enterprise#10737

This also solves an issue notably in website_slides where access to pdfjs
library was depending on connected users, due to assets mismatch. See
task ID-2352391 .

closes odoo/odoo#59610

X-original-commit: 000af2688e32d19b1874df2e909ccf0ddf636b91
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-09 11:17:29 +00:00
Aaron Bohy 2a44f9dcf3 [IMP] web: tz cookie: test if already set
This commit adds a test to save the effort of re-setting the tz
cookie when it is already set. We also merge the tz cookie script
with the one defining session_info.

Commit motivated by discussion on PR #55726

closes odoo/odoo#57218

X-original-commit: 0a43d8040f0c5ec8e9728b2e9da8c7d46d7292bb
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-09-07 17:22:14 +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
Lucas Perais (lpe) 86c4f79212 [FIX] web, website: move keyboard navigation and browser detection in common
Before this commit, the files keyboard_navigation_mixin.js and browser_detection.js
were defined both in assets_backend and in assets_frontend

Obviously then, they should be defined in assets_common, as this commit intends.

X-original-commit: 42e7c01024dcc8f5d0d0ee13c120bd31374837cd
2020-08-24 07:30:42 +00:00
Benjamin Vrayandqsm-odoo 745ef9de97 [IMP] website, web, portal: new options language selector in footer
Add an option to display the language selection inline or with a
dropdown. Add an option to choose if language labels are flags, text
or both.

Part of https://github.com/odoo/odoo/pull/55300
task-2203383

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 17:40:58 +00:00
Xavier Dubuc a17725e998 [FIX] mail: fix full composer opening with attachments
task-2307201

closes odoo/odoo#55678

X-original-commit: 9c47bb0b0034a3419a0c6e3267d90cb520a59535
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-13 10:23:25 +00:00
Aaron Bohy 6eb4762fee [IMP] base,web: set user tz to browser tz at first login
With this commit, the timezone (in the user's preferences) is
automatically set to the timezone of its browser the first time
this user logs in.

Task 2207715

closes odoo/odoo#55726

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-08-12 09:23:02 +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
Julien MougenotandMathieu Duckerts-Antoine bb3bc7c9e4 [IMP] *: adapt modules to Owl search panel
Adaptation of the rest of the environment to the changes regarding the
refactored search panel and model.

This commit includes the following changes:

- Since the control panel model is now part of the search model, the
view widget is responsible of its instantiation with the appropriate
API; creating an ActionModel holding the required model extensions.

- The controller is now importing/exporting the state of the entire
search model as well as the current state of the search panel (given
throught its props). Changes have been made to adapt to this behaviour.

- The multiple components linked to the control panel model have been
adapted to reflect the changes brought to it (they will now listen to
the "searchModel" instead of the "controlPanelModel").

- The `test_utils_create` methods have also been adapted to properly
instantiate a searchModel

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00
Julien MougenotandMathieu Duckerts-Antoine 7ff2e5822f [IMP] web: Search panel Owl
Refactoring of the search panel and its inner logic to Owl.

The previous search panel widget has been divided in 2 parts:

1. Component
The "Search Panel" component's responsibilities are now to render the
search panel data given by its model, display some rendering logic
(expanded categories, checked groups) and dispatch the events triggered
on it.

2. Model Extension
The "Search Panel Model Extension" holds all the search logic of the
search panel. Its responsibilities are calling the server to update its
data and to provide them to its component and other search extensions.

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00
Julien MougenotandMathieu Duckerts-Antoine d6ffbfd479 [IMP] web: Model: extensions registry
Refactoring of the Model class of `model.js` to support multiple
extensions.

The purpose is to build a model having the appropriate modules for a
given situation. For instance, we don't need the control panel model if
we don't have a control panel to start with.

Some logic of the control panel model (which was until now the "main"
search model) has been given to another model extension named
"Search Model Extension" which will synchronize the informations of all
models providing search data (domain, context, etc.).

The model instantiated in the actions/views is now an instance of the
"Action Model" (which directly extends the Model) and is meant to
replace the view model in the long term. It might however need some
improvements to hold such a role (partial interface rendering, etc.).

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00
Aaron Bohy 12cc5fd0cc [IMP] web: benchmark: revive benchmark suite
The benchmark suite has been broken for a while, by several
refactorings (e.g. use of native Promise). This commit makes it
work again. We do not use it much, but maybe we should as it can
be useful to track changes (mostly in view renderers) that impact
performances.
2020-07-16 07:03:05 +00:00
Aaron Bohy af85bb5e13 [IMP] web,*: do not deploy services in tests
*mail,point_of_sale,web_editor,website

In the tests, required services are deployed for each test
independently. There is no need to have, in additon, all services
deployed globally. Worse, it could conflict and lead to unexpected
results.

This commit ensures services are no longer deployed globally in
tests. It turns the module 'web.env' into a declarative module with
no side-effect, by moving the service deployment to main.js, which
isn't added to the tests page.

Task 2287397

closes odoo/odoo#53817

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-13 12:55:07 +00:00
Laurent Stukkens (LTU) 6df67a28c2 [REF] web_editor,web: reuse the autoscroll on drag feature
Prior to this commit, the autoscroll on drag feature was accessible and only
used in the web_editor application.

After this commit, the autoscroll on drag feature will be available in the
web application and has been refactored in order to allow its usage
in other application (as for the sign application).

task-2280965

closes odoo/odoo#54072

Related: odoo/enterprise#11656
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-08 12:13:33 +00:00
Benjamin Vray 79ce38fc3f [IMP] website, *: add the possibility to hide the copyright section
*: web

Part of https://github.com/odoo/odoo/pull/49142
task-2229551
2020-06-30 14:19:17 +00:00
Benjamin Vrayandqsm-odoo b43546c091 [IMP] website, *: add the possibility to hide the footer, per page
*: web

Part of https://github.com/odoo/odoo/pull/49142
task-2229551

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-06-30 14:19:16 +00:00
Benjamin Vray 904fea38a2 [IMP] website, *: add minor improvements on header / footer design
*: web

+ Ease edition

Part of https://github.com/odoo/odoo/pull/49142
task-2229551
2020-06-30 14:19:16 +00:00
Dhruv Patel 9e60a82680 [FIX] web: crash when multiple occurrences of cids in url
This error occurs for instance when your session expires and you
reload. At this point, the hash part of the url is duplicated and
an error is raised when the webclient tries to parse 'cids' part.

The hash part of the url should not be duplicated, but whatever the
url hash, the client should not crash either.

This commit prevents the hash part from being duplicated, and the
client from crashing when there are several occurrences of 'cids'.

closes odoo/odoo#52599

Task: 2267401
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-23 09:46:33 +00:00
c7964657ec [IMP] web: add support of "sample" attribute in views
With this commit, it is now possible to display sample (fake)
data in empty views, in the hope of easing user onboarding.
This can be enabled (in list and kanban views) with attribute
sample="1" on the arch root element. In this case, if there is
no data to display, sample data will be generated based on
heuristics (depending on field types and names). This can be
used in addition to the no content helper.

Task 2232801

X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jérémy Hennecart <jeh@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-22 13:04:01 +00:00
Aaron Bohy 26fe23201b [IMP] web,*: properly define env in the frontend
*bus,mail

This commit extracts the common basis of the env to use both in
the frontend and the backend. The public env now contains most of
the features that were previously (only) in the webclient env.

Moreover, the PublicRoot no longer uses the ServiceProviderMixin,
such that services are only deployed once, in the (public) env.

Owl components can now be defined in the website, and rely on a
properly built env. Legacy widgets still works as they access
services through the PublicRoot (via trigger_up) which redirects
those requests to the env.
2020-06-12 08:04:14 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot 087724fa9e [IMP] *: adapt tests to comparison menu
Tests have been adapted accross all affected modules to support the new
"comparison" menu component.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-04 19:32:52 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot be5a51a345 [IMP] web: Comparison menu
This commit replaces the "time range menu" in the control panel by a new
component: the "comparison menu".

Its purpose is roughly the same: compare a period of data in a reporting
view with the previous period or the previous year.

Its implementation is a bit simpler: it will only appear if at least one
date filter is selected in the search view, and will suggest to compare
each selected date option with the previous period or the previous year.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-04 19:32:42 +00:00
Thanh Dodeur 681306d4e7 [FIX] web: add access group to the pdf js template.
This commit adds the `base.group_user` access group to the `pdf_js_lib`
template so it can be lazy loaded in the JS.

closes odoo/odoo#51804

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-05-25 12:14:57 +00:00
Aaron Bohy 798931fc39 [REF] web(_editor): move jquery.nearest lib to web
This lib is also used by the Gantt view, so we move it to the
common basis between web_editor and web_gantt, which is web.

Part of task 2205607

closes odoo/odoo#51606

Related: odoo/enterprise#9740
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-05-20 09:33:04 +00:00
qsm-odoo 5863411437 [MOV] web: rename colorpicker_dialog.js file
The ColorpickerDialog will become a widget, this commit is only about
renaming the related file.

Part of https://github.com/odoo/odoo/pull/46088
task-2195313
2020-05-14 22:34:52 +00:00