Commit Graph
692 Commits
Author SHA1 Message Date
Sébastien Geelen (sge) c5c253c436 [FIX] web: better report preview
Report footer is sometimes misplaced in settings preview.
We change the css to always stick to the bottom of the preview,
no matter the content height.

Task-3145445

closes odoo/odoo#136534

X-original-commit: 9be75bb17063c6b0207aa82144e9f44b6e49dc45
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-25 18:09:56 +00:00
Shubham Thanki 66e8e65682 [IMP] web: allow users to download multiple vcards at once
This commit adds a download vCard server action in the list view of contacts,
making it possible to download multiple vCards at once.

Task-3385058

closes odoo/odoo#135435

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 10:14:06 +00:00
Romeo Fragomeli 49aa4dcf30 [IMP] web: add target=download act_url action
This commit adds `target=download`, as `target=self` adds some unwanted
visual effect. In other words, the "block UI" is never unblocked when
some actions are triggered. This is specific for "Download" actions as
the download is correctly executed, but the page is never `unload`.
e.g.:
```python
action = {
    'type': 'ir.actions.act_url',
    'url': '/web_enterprise/partner/%d/vcard' % record.id,
    'target': 'self',
}
```

Note:
We can't use "'target': 'new'" as it creates a bug in Mobile Apps.
When The Mobile Apps create a new "Tab/Page", they do it in a new
sandboxed browsing environment, so the user isn't logged in and the
resource isn't accessible anymore.

Task ID: 3435131

closes odoo/odoo#134436

X-original-commit: 08db3deb3336f0c1ff9fe2703ebeb8ea5b5aeb3d
Related: odoo/documentation#5822
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 15:34:37 +00:00
Aaron Bohy 93938cfdf3 [IMP] web,*: remove assets_backend_prod_only
This commit reworks a little bit the backend assets to remove a
bundle and thus save a call at webclient startup. The bundle
"assets_backend_prod_only" existed only to allow to add files in
production, but not in the tests (typically, the file that spawns
the webclient).

This commit introduces a new bundle "web.assets_web" that contains
"assets_backend" and the few files that we only want in production.
In the /web page, we now load "assets_web" instead of
"assets_backend" and "assets_backend_prod_only". In the /web/tests
page, we keep loading "assets_backend", which is now directly
included into "web.tests_assets".

For the sake of consistency, this commit also renames the dark
mode bundle "dark_mode_assets_backend" into "assets_web_dark".

closes odoo/odoo#135204

Related: odoo/enterprise#47316
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-13 08:20:40 +00:00
0903ef7bb2 [MOV] *: move all PWA to community
In this commit, we moved all features related to the PWA and the PWA
itself to the community.

This includes:
* PWA
* Web Push Notification
* VCARD

Note from original commits:
===========================

PWA (part 1)
------------
This commit adds a ServiceWorker to complement the WebManifest to
complete the setup of the backend as a Progressive Web App.

More precisely, it adds the route, registration and the most basic
ServiceWorker to allow the backend to be recognized as an installable
PWA.

References:
- https://web.dev/install-criteria/
- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs
- https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers

Task ID: 3063485

PWA (part 2)
------------
This commit adds a WebManifest as a first step toward setuping the
backend as a Progressive Web App.

In a nutshell:
- the web app's name is configurable through a config parameter
  (available in the Settings, in debug); defaulting to "Odoo".
- the web app's icon has been revamped to accommodate the required sizes;
  also its design matches the one from the Android app.
- "theme-color" is used to color part of the browser/system UI to match
  Enterprise brand color; also supports the dark mode.

References:
- https://web.dev/learn/pwa/web-app-manifest/
- https://web.dev/install-criteria/
- https://developer.mozilla.org/en-US/docs/Web/Manifest

Task ID: 3063485

PWA shortcuts
-------------
The main goal of this commit is like we did inside the `Android Odoo
Mobile App`, allowing users to have some Odoo application shortcuts.
We added the following apps in the key `shortcuts` on `web.manifest` in
these orders: `Discuss`, `CRM`, `Project`, `To-Do` (old `Notes`).

Links:
- https://w3c.github.io/manifest/#shortcuts-member
- https://developer.mozilla.org/en-US/docs/Web/Manifest/shortcuts

Task ID: 3123607

Offline mode
------------
This commit introduces a way to notify the user that he's "offline"
(aka. cannot reach its Odoo server) and that Odoo doesn't work in a
graceful way in this circumstance.

To do so, the Service-Worker will return the response of the
´web/offline´ route, which is cached at its setup.

Note: this screen is only show when launched while "offline" and fails
to load the requested page. It does not "interrupt" the WebClient to
show this screen when the connection drops off (cf. not a replacement
for the existing notification).

Task ID: 3203639

WebPush
-------

WebPush allows sending data to the user browser/app(PWA) even when
tab/app is closed. Web push is a "constant" link between the
ServiceWorker of browser/app and a WebPush server.

Note that each browser has its own custom WebPush server.
e.g.:
Chrome: https://fcm.googleapis.com/
Firefox: https://updates.push.services.mozilla.com/
Safari: https://web.push.apple.com/
Edge: https://wns2-ln2p.notify.windows.com/
WebPush introduces some cryptographic notion to ensure some the
reliability of the data sent:

VAPID: "Voluntary Application Server Identification" is the standard
used to generate the public and the private to sign the message
between the browser and the WebPush server
JWT: "JSON Web Token" is the standard used to sign the payload to the
WebPush server
ECE: "Encrypted Content-Encoding" is the standard used by WebPush to
encrypt the data of the payload to avoid sending RAW data
outside trusted network.
Simplified steps how to WebPush works:

The Javascript code of a web page subscribes to the WebPush server
(using the VAPID key generated at mail_entreprise install).
The WebPush server replay with a subscription (and some other info
like the unique URL endpoint per subscription where to send a
notification)
The application (odoo-bin in our case) sends a post request to the
WebPush server using the specific URL endpoint of the user (using JWT
and ECE).
The WebPush server sends back to the browser the encrypted payload.
The browser decrypts the payload and sends it to the ServiceWorker
linked to the subscription.
Here is a Sequence diagram of all interactions to process a web push
notification.
In Odoo, we use WebPush to send Notification to the user.

This commit aims to have a parity with the Android/iOS Mobile App at
the notification level.

Notes:

There are some ways to encrypt (ECE) the message for WebPush:

AESGCM128: this is a draft
AESGCM: very well documented
AES128GCM: RFC8188 Standard encoding
We implement only the RFC one as it is the only one implemented in all
major updated browsers (Chrome, Firefox, Safari, Edge, ...)
You need to allow the desktop "Notification" and "Push" inside your
browser. For iOS Devices, it only works on iOS 16.4+ and it's requiring
Odoo to first be added to the Home Screen. It's delivered silently,
meaning no sound, vibration, haptics or screen wake.

Note:
Notifications are sent directly if there are less than five
notifications, otherwise we use a cron triggered immediately.
Also, we have changed the value of the "QueryCount" as mail_enterprise
executes a new query to search the devices associated with the partner.

We have added a "try/except" for any Exception before the
push_to_end_point method as we want to avoid blocking a normal flow
just for a not mandatory push notification if something happens during
the push to the endpoint.
See: odoo/enterprise@d0ae70103d

Links:
https://www.rfc-editor.org/rfc/rfc8030
https://www.rfc-editor.org/rfc/rfc8188
https://www.rfc-editor.org/rfc/rfc8291
https://www.rfc-editor.org/rfc/rfc8292
https://w3c.github.io/push-api/index.html
https://autopush.readthedocs.io/en/latest/http.html
https://web.dev/push-notifications-web-push-protocol/
https://github.com/web-push-libs/encrypted-content-encoding
https://github.com/web-push-libs/pywebpush
https://github.com/web-push-libs/vapid
https://caniuse.com/push-api
Task ID: 3123678

VCARD
-----
In the process of replacing the native methods exposed in the mobile
apps, this commit implements the download of a vCard containing a
partner's information.

By using this standard format, both regular web users and mobile ones
are now able to save the partner's details to use them with their usual
address book software.

On a mobile device, the actual import of those informations is delegated
to the operating system.

References:
- https://datatracker.ietf.org/doc/html/rfc6350
- https://en.wikipedia.org/wiki/VCard
- https://github.com/eventable/vobject#vcards

Task ID: 2583916

===========
End of note
===========

Task ID: 3478014

closes odoo/odoo#133560

Related: odoo/enterprise#46530
Related: odoo/upgrade#5086
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>
Co-authored-by: Romain Estievenart <res@odoo.com>
Co-authored-by: Pierre Paridans <app@odoo.com>
2023-09-11 16:32:30 +00:00
Géry Debongnie e0fdb6a0b4 [IMP] *: rewrite module loader
This commit rewrite the module loader to simplify it and to improve error handling.
before this commit, you could have silent errors or "lucky" imports (import a module based on the fact that his asset will surely be load and if not, the error would be silent anyway).
e.g.: The tours cannot import modules extern to tours' bundle anymore. Or load module before your libs in assets.

TASK ID: 3266021

closes odoo/odoo#128502

Related: odoo/enterprise#44100
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-09-08 16:47:56 +00:00
Sébastien Theys 7a9581e1f3 [REF] web, mail, im_livechat: tests: remove afterNextRender
Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Samuel Degueldre 6f95be6884 [REF] *: remove web.assets_common
*: auth_password_policy, bus, event, im_livechat, mail, mass_mailing,
mrp_subcontracting, point_of_sale, pos_self_order, project, stock,
survey, web, web_editor, web_tour, website, website_event,
website_forum, website_sale, website_slides, base

Historically, the web.assets_common bundle was used to contain assets
that were needed by both the frontend and the backend. In practice, this
caused a bunch of issues where people would add things in assets common
that were not needed by both, and it was also abused as a way to get
bootstrap working in unrelated places by only using that bundle's css.

Because of this, as a first step, the assets_common stop being used in
the frontend, but was left everywhere else.

This commit removes the bundle completely, and moves the files that used
to be in that bundle in the other bundles that need them, this will
allow those bundles to evolve independently going forward.

in im_livechat and mail, some of the unneeded legacy code was removed, this
allows us to avoind including all of the legacy code from web in the
livechat embed bundle and in the dicuss public bundle respectively.

closes odoo/odoo#132190

Related: odoo/enterprise#45884
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-24 15:11:05 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Sven Fuehr 78abc4d2cd [FIX] web: fix address position in DIN 5008 document layout preview
Currently there is the following problem in the document layout preview:
("Settings" app > "General Settings" > "Companies" section > "Configure Document Layout")
The address is displayed in the wrong place for the DIN5008 layout
(from the l10n_din5008 module).

This is fixed in this commit.

closes odoo/odoo#131935

X-original-commit: 663334157cc4867c63aedea8d8d893eb765cfe25
Related: odoo/enterprise#45754
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
2023-08-14 18:12:58 +02:00
Maximilien (malb) 16488e5603 [IMP] l10n_sk,l10n_cz: invoice layout legal imp
before this PR, some legal information were missing from our invoice layout,
for the l10n_cz and l10n_sk localization.

For l10n_cz:
- On move we add a taxable supply date
- On the company we add a trade registry field
- On report template we add the company_registry, the vat number

For l10n_sk:
- On move we add a taxable supply date
- On the company we add a trade registry field and income tax id
- On report template we add the company_registry, the vat number and income tax
id

closes odoo/odoo#126837

Task: 3374969
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-08-08 22:41:00 +02:00
Géry Debongnie 286cc97dd4 [IMP] web: allow lang to be overriden by url query params
With this commit, it is possible to load the web client in a language
different than the user by using the `lang=` query string in the url:
For example, `/web?lang=en_US`

This is useful when we need to quickly check something, without changing
the current user settings. Note that it will only work if the url lang
has been installed on the database (if lang does not exist, it will fall
back to en_us).

closes odoo/odoo#128121

Taskid: #3420252
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-25 10:35:41 +02:00
Damien Bouvy e461e4e957 [IMP] web: better placeholders in the base report layouts
Include placeholders meant for the new studio editor engine.

X-original-commit: 87f66c19d5c1d27e2afa0aae697b768334275c88
Part-of: odoo/odoo#129492
2023-07-25 00:54:52 +02:00
Lucas Perais e792eb10f0 [IMP] *: sale order report: add demo data
Add Demo data in the Sale Order report to make edition more natural.

*: account, sale, sale_management, web

Part-of: odoo/odoo#128228
2023-07-20 17:01:31 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
xO-Tx 79a3fc20c5 [FIX] web: restore HTML report CSS
Steps to reproduce:

- Open base runbot with no installations > Install Account > Check an
invoice preview.
- Install Website > Check invoice preview > It looks narrow and does
not fill the available width.

Starting from [1], the code that sets the `container-fluid` class on
HTML web reports was replaced with the Owl version on the `ReportAction`
[2] but since some reports are not using this system, the code was
restored in a separate JS module on 16.0.

Starting from `16.1` (exactly after [3]), the JS code in
`web.report_assets_common` bundle was removed completely from the report
template, and reports are only using CSS [4]. So instead of a separate
JS module, a temporary script was added to the template to maintain the
same legacy behavior when a report is in iframe until all reports are
fully converted.

[1]: https://github.com/odoo/odoo/commit/feef532b417828905ce09675043b55b2b3736e43
[2]: https://github.com/odoo/odoo/commit/feef532b417828905ce09675043b55b2b3736e43#diff-ed0708a6c1a18e945a7829b2f8b17df7a2fbe4ab83e27fe6140dba79465c2832R39-R43
[3]: https://github.com/odoo/odoo/pull/104794/commits/37f009772ccb6bc9ed5733374e104e39c1e11792#diff-d9b97c730b0213bde5b18ab515e1e94fdb0809b8f760440ef7ca70163263101fL29-L30
[4]: Even after completely removing the JS code from HTML reports, the
`web.report_assets_common` bundle still contains some unused legacy
report JS code on stock: https://github.com/odoo/odoo/blob/saas-16.1/addons/stock/__manifest__.py#L98-L100
Maybe this code should be removed if it is not used anymore.

opw-3209231

closes odoo/odoo#126716

X-original-commit: 98d14a0b657efcfd365a4e7a28bef91f57758e6b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-06-30 00:20:50 +02:00
Viktors Lipskis (vili) cb4b9521d8 [FIX] web: include Bootstrap JS in reports
This commit adds Bootstrap JS assets to the web.report_assets_common bundle,
enabling basic interactivity in reports. Currently it is only necessary to allow
JS in the report_layout template.

#104794 removed all JS from reports, stating that they don't need any
interactivity. However, reports do sometimes require a bit of JS. An example is
the Green Savings Report in Sign (see task), which contains a Bootstrap modal.
By adding Bootstrap JS assets to web.report_assets_common, we can make the modal
work again. Additionally, we can fix/add basic interactivity in other reports if
necessary.

task-3285597

closes odoo/odoo#126638

X-original-commit: 21caa81fad84d05b76bd178242a991eef803e4b8
Related: odoo/enterprise#43263
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Viktors Lipskis (vili) <vili@odoo.com>
2023-06-28 17:42:07 +02:00
Yolann Sabaux a9d56620d2 [FIX] l10n_fr: enable invoice name on each page
Steps to reproduce:
- create an invoice with a certain number of items so that when printed there are multiple pages

Issue:
- the invoice name does not appear on each page
According to the French legislation it is mandatory

See https://entreprendre.service-public.fr/vosdroits/F31808

Solution:
- set a config parameter specifically for l10n_fr in stable
- set it in account directly for Master
To allow the footer of the invoice to contain the name (and therefore the number) of the invoice

opw-3199906

closes odoo/odoo#124989

X-original-commit: 7b071c995f1c9587cf4de56d6d1a632ea39db8ac
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-06-15 16:02:26 +02:00
Maximilien (malb) 96f22bd8f0 [FIX] web: company details
In Odoo editor when a html field is empty, we add en empty <br> inside the <p>.
This change broke all if statement checking that company details is empty.

In this commit, we add a function is_empty_company_details that return True if
the company details field contains only a <br> and False otherwise. With this
method, we can check that company details is empty and displaying other thing
that just an empty line break.

closes odoo/odoo#124440

Task-id: 3168705
X-original-commit: 2aaca9afb6c54be3ef87ea38646af90a2599aa6b
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-06-09 13:50:08 +02:00
Maximilien (malb) 7833e01255 [IMP] web: invoice layout
Before this PR, when multi vat was activated and a foreign vat number was set on
 a fiscal position it was not printed on the invoice for the following layout:
 Striped, light and boxed. The Bold layout is not impacted since it does not use
 company details.

 This PR adds the foreign vat on the invoice when it's necessary.

Task-id: 3248767
X-original-commit: 181bd158d149530d085b6da7e1c5ca3003f36bd3
Part-of: odoo/odoo#124440
2023-06-09 13:50:08 +02:00
hupo-odoo 78b674d8d4 [IMP] web: invoice layout preview
When invoicing the first time to a customer, the user can choose a style layout for the invoice.
The 'Striped' laoyout is a little bit different when we configure it and preview the pdf than when using it in an actual invoice.
This commit make the layout preview more accurate in relation to the real invoices.

Comment that led to the task : https://www.odoo.com/web#id=3232301&menu_id=4720&cids=1&action=333&active_id=809&model=project.task&view_type=form

closes odoo/odoo#123354

Task: 3236310
X-original-commit: 1852143a9cc56ec1ac9b8cfec5835fdc010fe7ab
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
2023-06-02 10:45:11 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
qsm-odoo ad63194af3 [FIX] web, *: use proper http-equiv="X-UA-Compatible" value
*: mail, point_of_sale, pos_self_order, web_editor

The `,chrome=1` part is no longer a supported value as the Google Chrome
Frame plugin was discontinued on February 25, 2014. See [1].

Indeed the W3C validator returns an error about this.

[1]: https://rocketvalidator.com/html-validation/a-meta-element-with-an-http-equiv-attribute-whose-value-is-x-ua-compatible-must-have-a-content-attribute-with-the-value-ie-edge

Part-of: odoo/odoo#120311
2023-05-11 18:25:07 +02:00
hupo-odoo 8823e01040 [IMP] account: Express VAT in local currency on invoices
Display the totals and taxes on pdf invoices in the company currency when the invoice is in foreign currency. This is a requirement from some countries where local authorities need the VAT to be expressed on the invoice in the national currency even if the invoice has been issued in another currency. The tax groups details are also required. The new information is expressed using a rectangle at the bottom right of an invoice. It includes the same information as the detail of totals and taxes above, with the difference that it is in company currency. If cash rounding is activated, the total rounded must not be displayed in company currency.

task : 3256515

closes odoo/odoo#118234

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-05-09 04:44:28 +02:00
Fabien Pinckaers 6d102d4ee4 [IMP] base: better copywriting for 'neutralized'
closes odoo/odoo#120263

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-02 15:59:10 +02:00
jobl db07dbdf32 [FIX] web: remove bg img when layout bg is Blank
Currently, the boxed and striped document layouts still pass in the
default background image when set to Blank. This image is mostly hidden, but
displays artifacts when printing or changing background color in program
like Paint. This fix removes the background image from these layouts when
"Layout Background" is set to "Blank".

In v15, Odoo changed the way that Document Layouts can be configured by
allowing the Geometric background image to be set on any of the base layouts.
A conditional was added to the standard and bold layouts to check the
selection for the "Layout Background" setting, and to set an empty string
for Blank. This conditional is missing for boxed and striped, causing
the artifacting issue. This fix adds in that conditional, which
removes the artifacting.

opw-3232991

closes odoo/odoo#118921

X-original-commit: 92f28da10e4fa3c80be0759c131febb5e6289e20
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-04-19 07:40:24 +02:00
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
Aaron Bohy 8fc4c6f2d8 [REF] *: remove legacy views support
The last view in the odoo codebase has just been converted to owl,
meaning that we no longer have legacy views. This allows us to
remove a lot of legacy view related code: the abstract elements on
which the legacy views were built, the compatibility layers that
allowed to deal with both owl and legacy views uniformly, legacy
widgets that were only used in those legacy views...

closes odoo/odoo#114893

Related: odoo/upgrade#4420
Related: odoo/enterprise#38005
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-10 13:33:04 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Aaron Bohy b2e267872f [REM] web: remove legacy views benchmark page
Those views are no longer used and about to be removed. This
commit also removes the benchmark lib as it is no longer used.

Part of task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:57 +01:00
Pierre Paridans 85c6f0b9aa [IMP] web: theme-color matches community theme
This commit sets the theme-color to match the Community brand color
instead of the Enterprise one.

task-3063485

closes odoo/odoo#109181

Related: odoo/enterprise#35322
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-11 22:42:56 +01:00
Pierre Paridans 3664e1c0c6 [IMP] web: remove unused Android icon
This commit removes link to an Android specific icon.

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans ec4bb75dec [IMP] web: cleanup Apple's web-app related meta tags
Deprecated tags in favor of WebManifest.

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans dcae6d7afc [IMP] web: remove deprecated msapplication-* meta tags
Windows 8 tiles and superseeded by WebManifest support in Windows
10/Edge 79+ (Chromium based).

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Ivan Yelizariev 4ca947c092 [FIX] base,web: fix address widgets in reports for RTL
This reverts following commits
1. a63f616c280ff464e331e3ba97265a8c29a86871
2. 5b7c3805a0

Instead of aligning address to left, we use default aligning, i.e. align to the
right for RTL langugages.

Commit n.1 was an attempt to finalize idea of the commit n.2, but it turned out
that left aligning looks just too bad for rtl users. So, this commit reverts
both of them, but keeps span/div changes in commit n.2

opw-3053457

closes odoo/odoo#109634

X-original-commit: 4af9fcf99f118e5dd85fb59d2e63f5b817233f07
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-01-11 14:31:03 +01:00
Ivan Yelizariev 255e5c5804 [FIX] base,web: fix address widgets in reports for RTL
Address widget has `o_force_ltr` class [1] since Odoo 14 [2]. Somehow, it didn't
work in Sale Order report and everything was RTL. But since Odoo 16 address part
actually became LTR. It mixes things up, because partner name and phone number
in the billing/delivery sections is still RTL [0].

This commit fix it by forcing whole address block to LTR. Alternative solution
could be removing `o_force_ltr` class, but this approach looks more risky and
should be done in master instead.

[0]: opw-3053457

[1]: https://github.com/odoo/odoo/blob/1666ee5515996fab8a843b36b4fd93b776172f75/odoo/addons/base/views/ir_qweb_widget_templates.xml#L26

[2]: https://github.com/odoo/odoo/commit/5b7c3805a045d8824dd1b4fa0de07d90b17392c1

closes odoo/odoo#106750

X-original-commit: a63f616c280ff464e331e3ba97265a8c29a86871
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-11-29 10:31:22 +01:00
Samuel Degueldre a1e7e3ef7e [FIX] web, *: tours correctly break when there are missing deps
*: im_livechat, website_livechat, website_slides

In c989ff3, the odoo module system has been changed so that it now
errors out when modules are defined but have missing dependencies and
cannot run. Unfortunately, tours are defined in a single bundle,
`assets_tests`, and this bundle is used everywhere tours need to run,
but some of these tours depend on modules that only exist in the backend
and others on modules that only exist in the frontend. We don't want to
break up the `assets_tests` bundle as this creates a poor developer
experience, and so the solution that was chosen at the time is that when
the `assets_tests` bundle is defined, we ignore all module dependency
errors.

This causes a problem however, which is that if a module dependency is
missing in production code, the page will be broken by the module error
(which is expected) but if the `assets_tests` are present, which is the
case when running tours and tests, then it won't, meaning the tours will
happily pass despite the application being broken, which is
unacceptable.

This commit fixes this issue by replacing the assets_test bundle by a
new bundle (`__assets_tests_call__`) within which all module dependency
errors are ignored, which lets dependency errors that are hapenning in
other bundles (ie in production code) happen even during the tests.

Because of this, this commit also fixes the dependency errors that
already existed but were previously silent:

- for im_livechat and website_livechat, the code was refactored to use
the standard mechanism that we use elsewhere to add data directly in the
page: we store the data in __session_info__, and the module that exposes
that data is always present, instead of having a module that's defined
conditionally, which causes issues when non-conditional modules depend
on it.
- in web, the `report_assets_common` bundle was used alongside
`assets_common` but without `assets_frontend` or `assets_backend`.
Reports do not need any js and it appears that it already had what it
needed as far as css is concerned except for one fontawesome override.
Code was changed so that the js from the bundle is not included and it
reports no longer use `assets_common`, the js part of the bundle is no
longer used.
- in website_slides, the `slide_embed_assets` bundle is used alongside
`assets_common` without using `assets_frontend` or `assets_backend`
which is required for `assets_common` to function, the approach here was
to simply take the files from `assets_common` and remove the files that
were causing issues. This bundle should be trimmed at some point, as it
contains way too many things that it does not need.

The file colors.js was also moved to core, as it isn't graph specific
and was causing dependency issues with a field that was importing it.
Fields shouldn't depend on files in specific views' directory.

closes odoo/odoo#104794

Related: odoo/enterprise#33909
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-17 15:59:16 +01:00
Samuel Degueldre c989ff339d [IMP] web: report module loading errors in the DOM
Previously, if there were module loading errors, they would typically
happen before the error service was ready, and so there is almost always
no user-facing error that shows up even though the application state may
be severely corrupted. This can be very confusing for developers who are
not used to working with JS and might not check the devtools console.

This commit makes it so that the module system will replace the contents
of the body with an error when some modules were unable to be loaded,
with the list of modules and the reason, so that the developer is not
confused as to why things aren't working as expected.

closes odoo/odoo#104155

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-10-27 15:41:15 +02:00
Pierrot (prro) 6acc85639a [FIX] web: adapt bold layout to new header
The previously created company_details field was introduced to allow
customers to manually edit part of their pdf headers. Only the bold
layout was not updated with this field.

closes odoo/odoo#104299

X-original-commit: 16ece79ea5305a2e427024a43313096fa200901f
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-10-27 14:41:26 +02:00
Romain Estievenart e574a13a6d [FIX] web: disable dark mode on test suites
As the current test suites are "light mode" based and to avoid
unexpected errors when running them locally (due to the cookie
possibibly being already set), the dark mode is disabled
for the following suites:
- `web.qunit_suite`
- `web.qunit_mobile_suite`
- `web.benchmark_suite`

X-original-commit: 3f1b44f0d2ce72f79308ef36cd72ea3f7b82b186
Part-of: odoo/odoo#104080
2022-10-25 19:39:51 +02:00
Romain Estievenart 06948a763e [IMP] *: adapt bundle to support dark mode switch
This commit adapt all bundle to support dark mode

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:54 +02:00
Laurent Desausoi 7593c073d2 [IMP] core: use inert SQL based neutralization
Before this commit the neutralize system introduced in v16 was using ORM
methods in order to change appropriate records. Although flexible, this approach
could lead to call some methods with side effects while neutralizing
(eg: overloads of write).

This patch converts the neutralize system to a safer "inert" SQL based approach
by migrating the generic method _neutralize to SQL files exposed in the
data folder.

Task id: 2961687

closes odoo/odoo#102792

X-original-commit: e5dbded9bb363351feff7ca8a56c7f8a6860f492
Related: odoo/enterprise#32580
Signed-off-by: Fabien Meghazi <fme@odoo.com>
2022-10-09 22:04:00 +02:00
Dossogne Bertrand 7c4da16b59 [IMP] mail, various: improve mail template usability
Allow our users to modify mail template more easily

- make the list accessible from the settings
- give them a link to update relevant views to update header/footer
- make the list and form of templates more readable
- add a description on templates, allowing to describe their usage

In order to better filter templates, a new category field is added that
is computed based on active flag, description being set and the template
having an xml ID. Master templates are active, with a description and an
xml ID.

Update master data to add description on some templates.

task-2944770

closes odoo/odoo#101730

X-original-commit: dfa867343ee8842f3f127ac62584fd471b41dde1
Related: odoo/enterprise#32079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-04 09:55:46 +02:00
Florian Vranckx 6a9b612a1d [FIX] web: tagline rendering box repport pdf vs preview
Steps to reproduce:
	- Go into settings > Configure Document Layout
	- Choose layout boxed
	- set a company tagline
	- click "download PDF Preview"
Issue:
	The styling of the company tagline is not the same on the pdf and
	the preview
Cause:
	Module lxml from etree would not interpret the html the same way as
	the browser. In the browser, we would have a 'p' markup inside of the
	'h4' for the title. Effectively applying the style from the css
	sheet. In the pdf, the lxlm module place the 'p' markup after the
	'h4'. Therefore it would not receive the styling of the 'h4'.
	Reproduction:
```
	>>> from lxml import html
	>>> html.tostring(html.fromstring('<div><h4><p>hi</h4></div>'))
	b'<div><h4></h4><p>hi</p></div>'
```
Solution:
	Modify the structure so we have a `<div class="h4"/>` element that does
	not have this issue. In version before 16.0, a CSS hack was used
	to keelp the structure the same.

opw-2846247

closes odoo/odoo#101666

X-original-commit: 5aaf60809f596f4ec3ae9c3bc4795b3044da0281
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-10-03 10:56:55 +02:00
qsm-odoo 0495ca05d5 [IMP] web: set width and height of tiny Odoo logo
In order to improve the page speed score and avoid layout shift, set
both width and height of the tiny Odoo logo used in the copyright
section of the website footers. This was able to be done with no
drawback:
- Set the width and height attribute of the image being loaded
- Leave the CSS rule `height: 1em;`
- Add the CSS rule `width: auto;` (which was implicit before)

By doing this:
- Once the image is loaded, the behavior is exactly the same as before
- While the image is loading, the height is still using 1em but the
  difference is that the "auto width" now know the final aspect ratio
  of the image thanks to the width and height attribute -> the width is
  thus the same as it will be once the image will be loaded (while it
  was 0 before)

X-original-commit: a709a10e0b746242a6bca1af2ce92020ec917464
Part-of: odoo/odoo#101149
2022-09-26 16:55:20 +02:00
Pierre Paridans 2571f6d4bc [MOV] web: enable responsive mode
This commit enables the WebClient's "responsive" mode by setting up the
"viewport" meta tag to allow it to scale to the device's width (instead
of being desktop-like only).

X-original-commit: 4d6169000aad92bed68879d90c360cb5cd62b8eb
Part-of: odoo/odoo#100759
2022-09-23 01:39:32 +02:00
qsm-odoo 08dcbc8f1d [IMP] web, *: move assets_common files directly inside assets_frontend
*: auth_password_policy, bus, calendar, event, mass_mailing, stock,
   survey, web_editor, web_tour, website, website_event, website_forum,
   website_mass_mailing, website_sale

This commit is a first step towards a potential deletion of the
assets_common bundle, although that step would need more work, specs and
discussions as some layouts kinda only use the assets_common bundle
(some take the full assets_common but parts of the assets_backend one
for example).

The main goal of this commit is to have the assets_frontend bundle
directly include the "common" files we need. As a first step, this
commit only blindly duplicates them all into assets_frontend (without
removing the potentially useless ones). The goal is to have those
advantages:

- Reaching a frontend page only calls two main JS files (one normal and
  one lazy-loaded) instead of 4 (two normals and two lazy-loaded). This
  may help reach a better google page speed (which is becoming more and
  more strict).

- The frontend CSS is built as one: the common SCSS which was using
  bootstrap variables, or even Odoo-based SCSS added by mistake in
  common instead of both backend and frontend is now computed with the
  right bootstrap customizations. E.g. the tempusdominus datetimepickers
  use bootstrap grays... after this PR, they use the right grays as
  customized by the user on the website.

It was also chosen to not have a common "sub-asset" which is included in
assets_frontend. Making assets_frontend completely independent makes
sense (as it probably will for other "main" asset bundles): we can focus
on adding the files each layout needs without the need of worrying if it
impacts unrelated layouts. Sub-assets (when not strictly necessary) is
also a source of errors: extending the "main" bundle instead of the
right sub-asset it may use (like it was the case with the sub-assets of
assets_common: _assets_common_scripts and _assets_common_styles as
explained in the previous commit). So this is indeed a small drawback of
not factorizing the code for the inclusion of "common" files in bundles
but it seems more explicit and easier to maintain that way. Note that
adding "common" file is not the most common usecase anyway, apps
generally only need files in backend or frontend.
The __manifest__ declaration will also likely evolve in more and more
uses of wildcards to match entire directories. In the future, adding
"common" web-app files in both backend, frontend and other "main"
bundles could just be about one line duplicated into each bundle.

closes odoo/odoo#100314

Related: odoo/enterprise#31394
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-09-18 08:37:06 +02:00
Romain Estievenart 98a97d0fea [IMP] *: removes .form-group
this commit removes the usage of .form-group class which is deprecated
since BS5.

Here is the css rules that was used:

a) https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L1997
As we can see, it simply adds a `margin-bottom` of `1rem` which
corresponds to the `.mb-3` BS class.

b) https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L2326
As we already checked all `form-inline` in [1] and [2], we don't have to
do anything about these rules.

'''Breaking change: Dropped form-specific layout classes for our grid
system.
Use our grid and utilities instead of .form-group, .form-row, or
.form-inline.'''

https://getbootstrap.com/docs/5.0/migration/#forms

Notes:
- `position: relative` is already on `#new-password-group`.
- `.field-db`, `#editor-media-image`, `.unsplash_img_container` and
`#url-form-group` seems unused.
- Sometimes margins are unnecessary because of blocks overlapping.
  (e.g. `margin-bottom` is not needed if margin-top is set on the
  following node)
- CSS rules applied on `.s_website_form_rows > .form-group` are now in
the XML by adding `mb-0 py-2` BS classes.

Follow-up of:
[1] https://github.com/odoo/odoo/pull/97967
[2] https://github.com/odoo/enterprise/pull/30343

closes odoo/odoo#100052

Related: odoo/enterprise#31261
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-16 20:51:56 +02:00
Gorash 5410b7c238 [IMP] base/web: XML templates are added into the asset bundles.
XML files are now declared in python module manifests. During the qweb
't-call-asset' directive, assetbundle will fetch the declared xml files,
apply the inheritance (t-inherit) and create a javascript service (for
eg: 'web.assets_backend.bundle.xml') which is added at the end of the
*.js mimifier file.

When the debug mode is activated, comments are added in the template
indicating which file the template comes from as well as the
inheritances applied to it.

****

JavaScript:

assets.js (module @web/core/assets) takes care of loading libraries,
javascripts and styles.
`loadJS(url)` (loads the javascript and returns a resolved promise when
the templates are also loaded via the '*.bundle.xml' service)
`loadCSS(url)` (loads the style a resolved promise when the file is
loaded)
`loadXML(xml, app=assets.defaultApp)` (load template into
application/owl, used by the `*.bundle.xml` services)
`getBundle(bundleName)` (get the bundle descriptor)
`loadBundle(desc)` (load the files and bundle from a descriptor)

templates (XML element content all owl templates)

A new `ready(serviceName)` method on boot.js lets you know when a
service is loaded are the require.

The xmlDependencies attribute no longer exists.

Python:

The xmls taken into account by assetbundle.py, applying `t-inherit`
inheritances and adding an `name_of_the_bundle.bundle.xml` service in
the generated JavaScript file.

****

Every manifest changes is into the next commit, except 'web_tour' in
this current commit as example.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Simon Genin (ges) feef532b41 [REF] web, stock: refactor report client code
This commit converts the report code to the new framework.

Since the module stock still has code that extends the old
"ReportClientAction", the old report code is put inside this module.
It can be then naturally removed once the module is fully converted.

closes odoo/odoo#97390

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-02 20:10:53 +02:00