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
closesodoo/odoo#60715
X-original-commit: 60c787679260a97c58f399af1a51d7549429f979
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
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 .
closesodoo/odoo#59610
X-original-commit: 000af2688e32d19b1874df2e909ccf0ddf636b91
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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 #55726closesodoo/odoo#57218
X-original-commit: 0a43d8040f0c5ec8e9728b2e9da8c7d46d7292bb
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
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
closesodoo/odoo#56995
X-original-commit: c121a246f16899735306266a3a12b526e08e7620
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
when user create a report using basic layout and at download time, it gives warning that
the template doesn't contain the attributes 'data-oe-model' and 'data-oe-id' on
the div with the 'article class name so this issue is fixed in this commit.
closesodoo/odoo#56511
X-original-commit: c58400a1d27f0994a620108af476813bf654e879
Related: odoo/enterprise#12658
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
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
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>
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
closesodoo/odoo#55726
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
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
QR-BILL report has no margin so we can position things exactly where
they needs to be according to standard.
For example the form must stick at the bottom and have 100% width, so we
can't use paperformat margin that would not allow to have 100% width.
With this change, we set default padding on header so it match
better "European A4" paperformat (that has 5mm top margin and 7mm right
and left margin) for stylistic purpose.
This is currently not configurable so for custom header size still need
view editing to change current values, but this at least make the
edition easy.
opw-2267041
closes#54717closesodoo/odoo#54725
X-original-commit: b758a02ae50fa13f090190accce1fa6d1dbde7d2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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>
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>
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>
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.
*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
closesodoo/odoo#53817
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
closesodoo/odoo#54072
Related: odoo/enterprise#11656
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In 13.0, the current company selected in the company switcher can be
different than self.env.user.company_id value.
Wizard "Configure Document Layout" (model base.document.layout) is using
the company in company switcher:
```
company_id = fields.Many2one(
'res.company', default=lambda self: self.env.company, required=True)
```
But the "Preview Document" button is using user company_id, so if you
change the layout then preview, you may see the report layout of another
company which make it seemed broken.
note: also improve code of point of sale added in 59f5e57 (in case of
point of sale, company maybe should be point of sale company but you can
print several ones and the company used on point of sales is the one of
company switcher).
opw-2269849
closes#53712closesodoo/odoo#53730
X-original-commit: bbb45e3412a5653d78aacc92903e95d1353ed60a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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'.
closesodoo/odoo#52599
Task: 2267401
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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>
*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.
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>
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>
Before this commit, the company address was aligned to the left in a column.
closesodoo/odoo#51626
Taskid: 2198488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit adds the `base.group_user` access group to the `pdf_js_lib`
template so it can be lazy loaded in the JS.
closesodoo/odoo#51804
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#51606
Related: odoo/enterprise#9740
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
When creating a new database, a random master password for it is
generated and strongly suggested to be used.
The motivation for this change is to have, by default, a secure master
password set for any Odoo deployment.
Often, users do not realise that, when making an Odoo installation
accessible on internet, anyone else can also access it.
Use autocomplete="new-password" for updating the master password and
play nice with password managers
When generating a new password, use autocomplete="new-password" as
well to prevent autofill of password potentially saved in password
manager.
Make the eye click to toogle on click instead of need to maintain.
closesodoo/odoo#45117
Task-id: 2091260
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Avoid messing up with style by translating it
closesodoo/odoo#50251
X-original-commit: 6151757a8357693e189ff1ab31ece5efdbac65d6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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.
closesodoo/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>
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');
});
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
closesodoo/odoo#47710
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
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.
closesodoo/odoo#49306
Related: odoo/enterprise#9797
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/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>
In 10.0 having a `section`, `subsection` or `subsubsection` on a footer
element would replace the content with the page top three level of
headings.
This was removed in 11.0 with b446930dc after which only `page` (current
page number) and `pages` (total number of page) classes would work.
This commit reintroduces the above-mentionned classes.
opw-2226700
closesodoo/odoo#48888
X-original-commit: 14c6b947ecf222524a577ec6a40d4a6e283aa2ad
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
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
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
* 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
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.
closesodoo/odoo#48085
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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>