Commit Graph
432 Commits
Author SHA1 Message Date
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
Aaron Bohy a3a415b130 [FIX] web: tests: detect failed modules in small suites
Before this commit, we waited for 10 seconds before defining the
boot test (checking that all JS modules have been correctly
loaded). However, small test suites (like the mobile one) ended
before this test was defined. So we could end up with a green
branch with tests not being executed (e.g. if a testing module
had missing dependencies, and was part of a small suite).

This commit removes the boot tests and instead does the check
at the end of the suite, before logging that the suite passed.

closes odoo/odoo#50109

X-original-commit: 048557eef32df94715ab464614c9d9d34c4a2689
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-24 08:11:17 +00:00
Michael Mattiello (mcm) dcf9a4c38d [IMP] web: add es6 class patcher
This commit implements a new way to monkey-patch ES6
classes (for instance, Owl Components).

Usage
-----

odoo.module('module.BaseClass', function (require) {
    const patchMixin = require('web.patchMixin');

    // Define your class as usual
    class BaseClass {
        constructor() {
            this.foo = 'foo';
        }
        bar() {
            console.log(this.foo);
        }
    }

    // but export it like this to have a "patchable" version
    return patchMixin(BaseClass);
});

odoo.module('module.Patch', function (require) {
    // imports the "patchable" version
    const BaseClass = require('module.BaseClass');

    BaseClass.patch('key', T =>
        class extends T {
            constructor() {
                super();
                this.foo = 'patched foo';
            }
            bar() {
                super.bar();
                console.log('patched bar()');
            }
        }
    );
});

odoo.module('module.instance', function (require) {
    // imports the "patchable" version
    const BaseClass = require('module.BaseClass');

    const obj = new BaseClass();
    obj.bar();
    // if module.patch is loaded before this module the patch
    // will be apply and calling obj.bar() will log:
    // patched foo
    // patched bar()

    // You can unpatch a patchable class
    BaseClass.unpatch('key');
});
2020-04-16 07:19:25 +00:00
Damien Bouvy 256c75baf7 [IMP] web: add a <Popover> component
Using bootstrap popover with owl is possible, but with a lot of
friction.

This commit adds a Popover element to ease developments that require
a popover. This component takes 2 props:
  - position='bottom' (optional): 'top', 'bottom', 'left', 'right'
  - title (optional)

Its usage requires setting an `opened` slot for the content of the
popover, whilst the 'trigger' of the popover uses the default slot.

E.g.
```xml
<Parent>
 <Popover>
  <t t-set="opened">
   <p>You have opened the popover, congratulations!</p>
   <button t-on-click='_handlerOnParent'>Dispatch cake</button>
  </t>
  <button class="btn btn-primary">Click me!</button>
 </Popover>
</Parent>
```

Note that:
- only one popover can be opened at a time (opening a popover will
close any previously opened popover)
- `Popover` uses `Portal` under the hood, so events are propagated
correctly even though the popover is teleported elsewhere in the dom
(see example in this commit message with `_handlerOnParent`)
- `<Popover>` is registed as a global component in QWeb and does not
need to be added to a Component's subcomponents list

closes odoo/odoo#47710

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-04-14 11:59:04 +00:00
Julien Mougenot ed38c2adb8 [FIX] web: flatten t-call-assets in test assets bundle
Before this commit, the test assets were called with a `t-call-assets` and contained
themselves some other `t-call-assets` to the back-end assets. According to the current
specification, having nested `t-call-assets` will result in a compilation of the
lower levels regardless of the current debugging mode.

Now, the test bundles (desktop & mobile) have been arranged so that their `t-call-assets`
are all called on the same level.

closes odoo/odoo#49306

Related: odoo/enterprise#9797
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-09 14:59:54 +00:00
Julien Mougenot 064a11890f [REF] web: remove unused test script in test assets 2020-04-07 14:41:43 +00:00
Julien Mougenot 89dbb49235 [IMP] web: bundle tests
Group all of the test scripts into a single minifyable assets bundle.
This has been done for both the QUnit desktop and mobile suites.

Task 2002399
2020-04-07 14:39:43 +00:00
Pierre Paridans eacc9bfe25 [FIX] web: remove script tag for non-existing test file
This JS test file has already been moved to enterprise.

Upgrade note: updating this template is not mandatory for existing
databases, but a nice to have for new ones.

closes odoo/odoo#49020

X-original-commit: 7b00581a249556695fbfc1b21cbe30d4c702787e
Related: odoo/enterprise#9685
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-04-06 09:37:20 +00:00
Romeo Fragomeli ebce7719b6 [REF] calendar,web: update to FullCalendar v4
This commit updates the FullCalendar library from v3 to v4.

The purpose of this update for us is to add a proper support of the
drag-and-drop of events on mobile.

But also to fix scrolling issues present mainly on smaller screens. In
those configurations multi/inner-scrolls were present resulting into
either the inability to properly scroll the desired content or even
blocking alltogether the scroll.

As a nice-to-have feature, the version 4 removes its dependency on the
jQuery library, allowing a faster loading of a bigger set of events.

Last but not least, this version also reduces its dependency on the
Moment.js library (but still keeps a binding to it for compatibility
purpose).

This commit focus only on the update of the library itself and the
adaptation of the related code to keep it working. Further
enhancements/fixes will be done later on.

To do so it modifies the following points:
* Update the library in itself (js, css...).
* Convert all FullCalendar's method calls to the new syntax (e.g.
  `$calendar.fullCalendar('destroy')` becomes `calendar.destroy()`).
* Add a utility method to convert v4 events into the old v3 event
  structure to ease the transition from one version to the other.
* Wrap all event's custom fields into a new event's
  `extendedProps` object (as its the new way of storing them instead of
  directly as a prop. of the event).
* Adapt `slotLabelFormat` and `weekNumberCalculation`.
* Use the view's new names:
** `agendaDay`  -> `timeGridDay`
** `agendaWeek` -> `timeGridWeek`
** `month`      -> `dayGridMonth`
* Use the option's new names:
** `viewRender`      -> `datesRender`
** `eventMouseover`  -> `eventMouseEnter`
** `eventMouseout`   -> `eventMouseLeave`
** `isRTL`           -> `dir`
** `selectHelper`    -> `selectMirror`
** `weekNumberTitle` -> `weekLabel`

Ref:
https://fullcalendar.io/docs/upgrading-from-v3

Task ID: 2092550
2020-03-31 15:06:11 +00:00
Michael Mattiello (mcm) 4520a09f2c [REF] web: convert FieldBoolean to owl
This commit does 4 things:
- adds a file for deprecated legacy fields.
- moves legacy FieldBoolean into this file.
- converts FieldBoolean to owl component.
- adds a new xml file for component fields' templates.

task id: 2193996
2020-03-31 07:11:01 +00:00
Michael Mattiello (mcm) 9324282b01 [REF] web,*: add new field registry for components
* account

This commit adds a new field registry for component fields.
This field registry is used to only register the new field components
and the other one should register the legacy fields.
Those two registries will be used together while all legacy fields are
not converted to owl component.

As the legacy registry now throws an error when adding a component
field the existing component fields (account.ShowGroupedList and
account.ShowResequenceRenderer) are moved into the new registry.

This commit also refactors some field managers (form renderer, list
editable renderer, calendar popover) to use the new registry and thus
support the component fields.

task id: 2193996
2020-03-31 07:11:01 +00:00
Michael Mattiello (mcm) 91c7e574ed [ADD] web: add CustomCheckbox owl component
This commit adds an owl component for the Odoo custom checkbox.

task id: 2193996
2020-03-31 06:13:11 +00:00
Julien Mougenot 70d426b948 [FIX] web: fix dataManager loading caches
Before this commit, coming back on a view when in 'debug=assets' would erase the
previously loaded favorites with an 'undefined' value. This was due to an incorrect
cache invalidation mechanism in the DataManager's load_views' method.

Now the views and filters caches are properly loaded if any of them has been invalidated.

closes odoo/odoo#48085

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-24 09:57:00 +00:00
Julien MougenotandMathieu Duckerts-Antoine bb8eb766a8 [REF] web: Control panel tests
Use of the new helpers in control panel (and subcomponents) tests and addition
of new tests.

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 fbf347498f [REF] web: Control panel Owl
Refactoring of the control panel with the Owl framework.

The MVC structure of the control panel has been changed to a 'component <-> model'
relationship. As such:
- Removed the old control panel: view/model/controller/renderer
- Created a new Owl Component (ControlPanel)
- Created a new class: the Model (an Owl Store did not fit here) and a newly
  designed ControlPanelModel extending it

Refactored all inner subcomponents, including:
- Pager
- ActionMenus (peviously SideBar)
- Filter menu
    > Custom filter item
- Group by menu
    > Custom group by item
    > Removal of groupby_menu_mixin (and refactored graph controller in sibling commit)
- Time range menu
- Favorite menu
    > Custom favorite item
    > Moved the favorite menu registry to the favorite_menu file
- Search bar
    > Removed and splitted auto-completion dropdown logic between the new SearchBar
      Component (descriptions) and to the new ControlPanelModel (domains).

The templates (all in web/base.xml) have been adapted to the new standards. Most
of the DOM structure remains unchanged with some occasional improvements (replace
hiding with not rendering, removed pointless wrapper divs, etc.).

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 0a129284e4 [IMP] web,*: Enhance test helpers
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 11:39:53 +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
Pierre Paridans 65cded061f [REM] web: remove condition comments targeting old IE versions
As we don't support anymore Internet Explorer browser, we can safely
remove conditional comments targetting older versions of it (and even
not supported in IE since version 10).

Also, when executed, this could have added a second `<body>` tag (which
is not valid HTML document).

References:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
https://en.wikipedia.org/wiki/Conditional_comment

closes odoo/odoo#47170

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-03-09 10:07:51 +00:00
Pierre Paridans e0e950c450 [IMP] web: shorten odoo.reloadMenus implementation
This commit takes advantage of modern JS syntax (like Fetch API, arrow
functions) to shorten the `odoo.reloadMenus` function's implementation.

Original implementation of this function was in commit 8a28cc22fd
2020-03-09 10:07:51 +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
qsm-odoo d04ca05b2e [FIX] web, *: add lazy loaded libs in the test assets
*: partner_autocomplete

Those cannot be properly lazy loaded by test widgets, so they are loaded
directly through test assets. Testing lazy loading should be part of
a dedicated test system.

Part of https://github.com/odoo/odoo/pull/44596
2020-02-05 10:48:38 +00:00
Michael Mattiello (mcm) 3fd7b2009e [ADD] web: add owl AbstractField
This commit adds the new AbstractField class written in owl,
meant to be extended by specific Field owl implementations.

Note that its API is not complete yet, but it is enough for
basic usecases.

This commit also adapts the BasicRenderer to instantiate the
future new fields that will be written in owl.

closes odoo/odoo#43759

Related: odoo/enterprise#7872
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-02-03 11:08:04 +00:00
Aaron Bohy 8641c46ccb [FIX] web: do not deploy services twice
Since 671a5471cd, services are deployed twice in the backend:
once by the webclient (as it is a ServiceProvider), and once by the
env (which now deploys the services to make them directly available
for each Owl component of the component tree). As a consequence,
some services perform twice some operations (e.g. the mail service
fetches twice the /mail/init_messaging route, the crash manager
service displays twice the tracebacks...).

This commit fixes the issue by making the webclient directly use
services from the env, instead of deploying them a second time.

Part of 2183810

closes odoo/odoo#44301

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-01-31 10:35:37 +00:00
Romain Derie 98678199a3 [FIX] *: fix translations inconsistency in 't-set'
This commit fix most `t-set` errors that either led to:
  1. unwanted text to be considered as translatable.
     eg: `<t t-set="classes">text-left bg-100 p4</t>` would create an
     `ir.translation`.
  2. text that should be translatable were not.
     eg: `<t t-set="text" t-value="'Both'"/>` would not create an
     `ir.translation` while it should.

If a text should be translatable, it should never be inside a `t-value`:
  - `<t t-set="text">Both</t>`
If a text should not be translatable, it sould either be inside `t-value`,
`t-valuef` or the `<t>` tag should have `t-translation="off"`:
  - `<t t-set="classes" t-translation="off">text-left bg-100 p4</t>`
  - `<t t-set="classes" t-valuef="text-left bg-100 p4"/>`
  - `<t t-set="classes" t-value="'text-left bg-100 p4'"/>`

https://github.com/odoo/odoo/pull/43660
https://github.com/odoo/enterprise/pull/7839
https://github.com/odoo/design-themes/pull/203

closes odoo/odoo#43660

Related: odoo/enterprise#7839
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2020-01-21 15:32:08 +00:00