Commit Graph
89 Commits
Author SHA1 Message Date
Xavier Morel 5dd8159e13 [REM] website_event_track: pwa registration success log
Not very useful to the average user, and can fill up logs during
tests (mostly 16.1 onwards for some reason but might as well square
up everything).

closes odoo/odoo#137149

X-original-commit: 4461d90e534d7568e6b676913c959d9d083f88fc
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-02 08:03:45 +00:00
Michael (mcm) 7422eb643c [IMP] *: remove legacy rpc
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.

closes odoo/odoo#136271

Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-27 11:33:01 +00:00
Pierre Pulinckx (pipu) ce38e06801 [REF] *:replace moment usages with luxon
luxon and moment are both used in the solution, but these two libraries
facilitate the manipulation of dates. It was decided to replace all uses of
moment with luxon so we can then remove moment.js from the code and lighten
the assets.

task-3391739

closes odoo/odoo#133144

Related: odoo/enterprise#46447
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-08-31 14:14:59 +00:00
Michael (mcm) 55f1822911 [IMP] web,*: remove services/config.js
This commit removes the module services/config.js and adapts the module
that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Jorge Pinna Puissant f956e83c74 [REF] *: remove qweb.render
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:28 +02:00
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
Pierre Pulinckx (pipu) b1ebe3b6f4 [REF] *: Replace core._t imports
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
 web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.

task-3292454

closes odoo/odoo#130865

Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-09 00:13:08 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
Pierre Pulinckx (pipu) 504b4a7178 [REF] *:Replace moment usages with luxon
luxon and moment are both used in the solution, but
these two libraries facilitate the manipulation of dates.
It was decided to replace all uses of moment with
luxon so we can then remove moment.js from the
code and lighten the assets.

task-3391739

closes odoo/odoo#127406

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-13 14:47:41 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Pulinckx Pierre (PIPU) 608e90e998 [REF] *: Replace underscore functions by native JS
Replace _.map(), _.flatten(), _.delay(), _.contains(), _.pluck(), _.isUndefined(), _.isEmpty(), _.isString(), _.isEqual(), _.isBoolean(), _.memoize(), _.invoke(), _.bind(), _.escape(), _.debounce(),
_.str.sprintf(), _.str.repeat(), _.str.startswith(), _.str.trim(),
_.str.escapeHTML(), _.str.escapeRegExp(), _.str.startsWith(), _.str.include()

closes odoo/odoo#118012

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-04-20 11:57:29 +02:00
Pulinckx Pierre (PIPU) 800223ae7c [REF] *: Replace underscore _.each() by native JS
Replaced _.each() functions (average 235 occurences)

Description of the refactoring this PR addresses:

Current behavior before PR:

There are underscore.js function enumerated above used in odoo.

Desired behavior after PR is merged:

These functions has been replaced by native javascript
prototypes/methods/functions.

TaskId : 3246238

closes odoo/odoo#118565

Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-04-18 15:38:54 +02:00
Benoit Socias 02ed9f5e66 [FIX] website, *: avoid using unescaped query parameters
*: google_recaptcha, web_editor, website_blog, website_event_booth,
   website_event_exhibitor, website_event_track, website_forum,
   website_jitsi, website_sale_comparison, website_slides,
   website_livechat, website_twitter

This commit fixes improperly escaped query parameters across javascripts
of website-related modules.

See https://github.com/odoo/enterprise/pull/31711

closes odoo/odoo#118599

X-original-commit: 89be076aa51b097ada48d0046006be4d9692ac1e
Related: odoo/enterprise#39783
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
2023-04-18 11:33:46 +02:00
Pulinckx Pierre (PIPU) 614de86989 [REF] *: Replace underscore function by native JS
Replace _.isNumber(), _.filter(), _.reject(), _.unique(), _.indexOf(), _.lastIndexOf(), _.findIndex(), _.range()
_.keys(), _.values(), _.str.sprintf() and some _.each()

closes odoo/odoo#118003

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-13 16:40:11 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
qsm-odoo d49200feca [REF] website, *: remove (deprecated) $target uses in public widgets
*: auth_totp_portal, mail_group, portal, survey, web, website_event,
   website_event_track, website_mail, website_mail_group,
   website_mass_mailing, website_payment, website_sale

Although this is deprecated since 5 years with [1], new occurrences of
`this.$target` in widgets kept being introduced. `this.$el` can be used
just like in any other widget, or even better: `this.el` to not rely on
jQuery.

For now, this still keeps the definition. This just removes the bad uses
to prevent more copy/paste... let's delay the decision to remove the
definition entirely to another day.

[1]: https://github.com/odoo/odoo/commit/2972976962617d4b8a0113bae58c640ab41cdff8

closes odoo/odoo#106437

Related: odoo/design-themes#618
Related: odoo/enterprise#34343
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-24 19:25:14 +01: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 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Jérémy Hennecart (jeh) 8285c2a6d1 [IMP] website_event(_*): refont frontend based on colors chosen
This commit removed static background color and the like in all event
modules. Since it's possible to configure colors from the website_editor,
we should used these ones in the frontend.

When an element is superposed on the background we used the later with a
mix of the primary color to have a demarcation and a better visibility
based on the colors chosen.

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:03 +02:00
Pierre-Yves Dufays 29bf004bc1 [IMP] website_event{|track|exhibitor}: improve UI of event app
Improve UI of event app.

Detailed changes:

1) change the wording of the selection item "sponsor" of
event_sponsor.exhibitor_type from "sponsor" to "Footer Logo Only"
2) event name placeholder changed to (quote added):
e.g. "Conference for Architects"
3) in the track page and exhibitor page, if the description is empty:
- for external user: hide the empty description zone for external user
- for internal user: display an alert (info) inviting the user to complete it
with a link that triggers the edit mode.
3 bis) in the track page and exhibitor page, the page and the menu aside
are glued to the top. Add some space there.
4) display unpublished tag on the side menu for unpublished tracks

Some other changes:
- When some content are empty, there were some awkward horizontal lines
separating nothing, we have decided to remove them
- Fix track layout and improve mobile layout

Task-2692907

closes odoo/odoo#83488

Related: odoo/enterprise#23798
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-04 15:15:48 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romain Derie d348bed1ad [IMP] website, *: use upsert to improve visitor perf
* im_livechat, test_event_full, website_blog, website_crm,
  website_event, website_event_track, website_event_track_quiz,
  webite_livechat, website_sale

There is 6 main changes in this commit:

1. Using raw SQL Upsert instead of the ORM methods. While raw SQL should
generally be avoided, it makes sense for such a low level behavior which
is impacting every flows.
Indeed, tracking visitors is a generic behavior done on all pages and
controllers. It is important to optimize it to reduce processing time
and SQL Queries.
Benchmark of that change alone:
> Rendering a tracked page improves from ~19.5ms to ~17ms (using `ab`
  with 1000 loop) and the requests involved in the tracking process are
  reduced from 8 SQL Queries to 3:
  - 1 request to upsert the visitor
  - 1 request to fetch the visitor data
  - 1 request to add the tracking record

2. Adding in that upsert query the `visitor.track` insert, creating both
records in one go, bringing the query count from 3 to 2.

3. Refactoring of the `parent_id` behavior that was introduced in stable
with [1]. The purpose was to keep track of multiple visitor linked to a
same user to merge the tracking together. Especially useful for tracking
a same visitor on different devices (when logged in).
Only one visitor was kept as active, others would be archived and their
tracks would be set/moved to the main partner.
Removing those duplicate visitor was not possible because those archived
duplicated visitor were holding the devices notification push token.
Since [2], those token were moved to their own table, all related to the
main visitor.
We can then now safely remove those duplicate visitors after merging
their track to the main visitor. Thus, the `parent_id` field is no more
useful. Removing it removes a layer of complexity.
Note that thanks to this part, the `active` field can also be removed.

4. Deeper functionnal change, inspired from Plausible: The access_token
is no more stored in a cookie but is the result of a hashing method
based on <IP Adress, User Agent>.
The reason behind that change is that, in an upcoming refactoring,
sessions won't be stored anymore unless absolutely needed (login, add to
cart..). It will also ship a no cookies policy, trying to get rid of all
cookies.
This change is bringing some functional changes:
- Since the IP is included in the hash to generate the token, it means
  that:
  A. If an anonymous user switch IP (eg from 4G to wifi), it is
     considered as a new visitor.
  B. If 2 anonymous users with the exact same user agent (same browser,
     same browser version, same exact os or phone) are on the same IP,
     those will be considered as the same visitor.
- Since the request host is not included in the hash, it means that
  visiting a DB from 2 differents URLs (domain and/or ip) on the same
  device and same browser will result in a shared visitor.
  It shouldn't imply any issue as this is A. not wrong and B. mostly
  used for tests.
As all this is only related to non logged in user, it shouldn't be a
real issue as anonymous visitors are not supposed to be meant to be
business critical, even if we use them for "a bit more" than simple
analytics data.

5. The access_token is now replaced by the partner_id once the user logs
in, so:
- We don't need to either search on the partner_id field or the
access_token field (depending if the user is logged in or not), we can
only use the access_token row/field to do both.
- On logout, everything works out of the box as the access_token will be
regenerated since there is no partner_id anymore.
- On login, if an access_token matches the user's partner_id, that
visitor is returned.
If there is no such token, a new visitor is created for that partner_id.
In both 2 cases, tracks are moved to that visitor and the anonymous
visitor is removed.
- We can remove the code that was in charge of checking if the
access_token / visitor cookie was wrong (coming from another user eg,
different user login on same device). Indeed, such collision is not
possible anymore as the access_token automatically match the logged in
user.
- We can remove the code that was in charge of checking if the
access_token / visitor cookie was wrong (coming from a logged in user
while the current visitor is not loggedin). Such collision is not
possible anymore as the access_token is (re)generated as an anonymous
token (hash) when not logged in.

6. There is no more check to prevent a track to be created if there was
already a track for that URL in the last 30 minutes.
While this can easily be re-introduced (one CTE on the upsert), it was
adding ~100ms (from ~20 to ~110ms) to the request on a big database as
Odoo where there is ~100 millions tracks and ~100 millions visitors.
It has been validated that it was not a real issue as it is not
fundamentally wrong. If a visitor visited 20 times a product or a
specific page in that short amount of time, you might want to know that
because the user is most likely interested by it.

Changes (1+2), 3, (4+5) and 6 are all independant from each other and
could have existed on their own.

[1]: https://github.com/odoo/odoo/commit/c6b8a44b970a46dcd87a4e2cb1ad52fa340b209f
[2]: https://github.com/odoo/enterprise/pull/16781/commits/f75090fe8b42484e89e933976e8441d2f5eb9415

task-2867045

closes odoo/odoo#87857

Related: odoo/enterprise#28004
Related: odoo/upgrade#3566
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-06-07 16:31:20 +02:00
Pierre-Yves Dufays 80115e8dd3 [IMP] website_event: improve web tracking
In 2 ways:
- by ignoring prefetched pages: indeed some page were reported inaccurately
as being viewed by the user when they were only prefetched.
- by adding the page /event in the tracked page as the page is obviously
important in the event business

Technical notes:
- The prefetched pages are ignored thanks to an header X-Disable-Tracking added
on each prefetch request in the service worker.
- Adding the page /event as a tracked page has increased the number of queries
when browsing the page /event. That's why some query count have been updated in
TestOnlineEventPerformance.

Task-2476513

Part-of: odoo/odoo#86031
2022-04-29 08:09:58 +02:00
Jorge Pinna Puissant bc20eb4790 [IMP] test_lint, *: enable no-unused-vars rule
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
Julien Banken c1b7944a67 [IMP] website_event_exhibitor: add a popover on the exhibitor cards
On the website, the exhibitor cards only shows a logo. If the visitors
clicks on a logo, the visitors will be redirected to the website of the
corresponding exhibitor. If no website has been set and the logo of the
exhibitor is rather abstract, the visitors may not be able to recognize
and identify the exhibitor.

To provide more information about the exhibitor, we will add a small
popover that will be opened when the visitor clicks on the logo. The
popover will contain the following information:

- The name of the exhibitor
- The website of the exhibitor

Other information are considered as private and can be added through
customization if this fits specific use cases.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:24 +00:00
Aurélien Warnon d63674d989 [IMP] website_event_track: submit track proposals using AJAX
Currently, track proposals are submitted through an HTML form with an "action"
attribute, which requires that the associated route returns a redirect
response.

However, redirecting to a different page comes with its set of issues.
Indeed, when the track is submitted, the user that just submitted the track no
longer has access to it (because it's not published).

In 157a1d77058da97954edc9efba6ab9f43c7d13a2
We attempted to resolve this issue by checking if the partner set on the track
is the same as the partner set on the website.visitor record.
However, this does not handle every use cases since when specifying different
contact information, we create a different res.partner, making the check fail.

In this commit, we rework the track proposal submission to use AJAX instead.
This allows to dynamically show a "success" message while staying on the same
page, removing the need for redirects and "complex" ACLs checks.

While the main goal of this change is to avoid the need for that security
check, it also has a few additional minor advantages:
- Slightly faster UI, as you don't have to wait for a full page reload
- Fewer routes to maintain
- Easier and more thorough validation handling (current code returns a ugly
  error page if validation fails server-side)
- Code makes a bit more sense, as we don't have a template that varies from
  "form" to "success message" depending on the presence of a "track" variable

Task-2618734
UPG PR odoo/upgrade#2722

closes odoo/odoo#74848

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-17 14:28:17 +00:00
Aurélien Warnon beb6c47876 [IMP] website_slides: apply linting on track proposal JS files
This commit does not change anything, it simply applies linting on the track
proposal JS files to match our current guidelines.

This is done as preliminary work since we are going to change the way track
proposals are submitted (from POST request to ajax POST).

Task-2618734
2021-08-09 12:14:42 +00:00
Nicolas Lempereur ffd062a3bf [FIX] website_event_track: no cookie lifetime service worker error
If you use firefox and have set cookie to be deleted when you close
firefox, server worker are nuked which cause an error to be shown in
website_event_track:

https://bugzilla.mozilla.org/show_bug.cgi?id=1429714

With this fix, the error is handler and shown in the console instead of
as a traceback to the user.

opw-2556734

closes odoo/odoo#74890

X-original-commit: 8e81db2515dbed196433f2127591384f2e23bfaa
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-08-09 18:38:40 +00:00
Sunil Shrimali 7ff89c188c [IMP] website_event_track: improves ui for unpublished event_tracks
Unpublished tag not shown if track is not accepted, although track is not
published. Unpublished tracks was also visible for portal user. opacity
was not available on tracks, even track is unpublished.

unpublished tag added into event agenda next to 'not accepted', also
added blurry effect and unpublished tag into agenda which is
shows in details page. used normal text in place of badge for
unpublished track, because that red badge is already used by live
tag. Onwards now, unpublished track will not show to portal user.

TaskID - 2346612
2021-07-06 04:44:46 +00:00
Jorge Pinna PuissantandSamuel Degueldre f43a0814ae [IMP]*: configuration of ESLint for specific files
This commit will add the needed ESLint configurations on the JS files.
These configurations are added if the JS file uses a different
environment (serviceworker, node, etc) or if it uses a specific global
(google, ace, etc).

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-05-04 13:32:49 +00:00
Julien Banken 0f50285cf6 [IMP] website_event_track[_live]: add visual & usability improvements to event.tracks
PURPOSE

This commit adds several minor visual improvements to the event.tracks
frontend and backend views as well as a few quality of life changes to
ease usability.

SPECS

- Add "hide and show" feature for tracks

In the event homepage, all the tracks of the selected event will be
displayed. As the tracks are grouped by day, some sections will only
contain tracks that have already taken place. If there are a lot of
tracks, it might be better to fold these sections to reduce the payload
of the page. That way, the user will be able to see the upcoming tracks
more easily.

With these changes, a new chevron icon will be added above each section.
When the user clicks on it, the user can fold and unfold a section.
By default, the section containing tracks that have already taken place
will be initially folded.

- Add partner tag line

The user may need to know more about the speaker before attending a
talk. The user may wonder: Who will give the talk ? What is his/her
field of expertise ? Where the speaker comes from ? To answer these
questions, we will display: the name, the job position and
the company name of the speaker.

- Add replay suggestion when no suggestion can be provided

When a video ends and no suggestion can be provided, the player will
display an empty cover to hide the Youtube suggestions. With these new
changes, the cover will now suggest the user to replay the video when
no suggestion can be provided.

- Dynamic count down for incoming tracks

When the user accesses a track that will start in several hours, an alert
will indicate the remaining time before the beginning of the track.
Unfortunately, this alert is not dynamic: If the user keeps the page in
a tab and come back later, the alert will not be updated and will display
an incorrect estimation.

The changes address this issue: The timer will now be updated dynamically
as the time goes on. When the countdown reaches 0, the alert will
automatically be removed from the dom.

- Fix links of the agenda view

In the agenda, the title of a track can be a link. When the user hover
it, the cursor of the user will now turn into a clickable hand only if
the track is accessible.

- Remove the default date for the new tracks.
- Set a default duration of half an hour for the new tracks.

LINKS

Task-2347597
COM PR odoo/odoo#69102
ENT PR odoo/enterprise#17612

X-original-commit: 6804b8a92c03db09c2694150f968d8056492a1d4
2021-04-12 10:39:58 +00:00
Julien Banken 17edf6712d [IMP] website_event_track: ask for notifications when favoriting a track
PURPOSE

When a user adds a track to his/her favorites, we really want to make
sure that the notifications are activated so that he/she can be
notified when a track is about to start.

The "Set Favorite" button of the tracks will now propagate a new event
that will notify the notification manager that a new push notification
request should be issued immediately.

SPECS

- Trigger a new event when the user adds a tracks to his/her favorite.

LINKS

Task-2347597
COM PR odoo/odoo#69102
ENT PR odoo/enterprise#17612

X-original-commit: 0e28bfdea3938b1d76cb62223b84f155a6ce75d7
2021-04-12 10:39:57 +00:00
Noe Antoine d47d64963e [REF] website_event_track: Track Proposal Form Revamp (GDPR)
Distinguish and display to the speaker which info is collected by the form
for internal use vs external dissemination. The contact details one wants to
share with the event manager (Private details : contact_phone, contact_email)
could indeed be different from the ones shared to attendees (partner_phone,
partner_email,...). The form in both back-end and front-end is made more
detailed, including more fields. Previously the form could have several
speakers, now only one.

Front-End

- Track proposal form changed, now includes tags, contact / speaker info...
- Track name and description are mandatory fields
- User can select (but not create) several track tags from those existing.
  This allows categorizing the track in pre-defined categories with format
  "tag category : tag name". It requires a select2 widget,
  implemented in new file website_event_track_proposal_add_tag.js.
- New tickable section "contact me through different contact" not displayed
  if the checkbox is not ticked. If the section is ticked, then the info set
  there (contact_name, contact_phone, contact_email) will be added on a new
  contact with id partner_id set on the track.
- In both cases (checkbox on/off), if the contact/partner email is the
  same as logged user's, uses its partner on form. No contact creation needed.
- Improved / dynamic error display on form submission. If the form is valid,
  it resets after submission.
- New widget in website_event_track_proposal.js:
    - The partner_name is propagated on contact_name on input but editable.
    - When the optional section is checked:
	- The contact_name is made required.
	- The user must at least enter a contact phone or an email. The email
          is normalized but any phone format is accepted, since the choice of
          country is not resolved (e.g. geoip not always relevant). Could be
          improved with international phone number widget, see COM PR #34725

Back-end: following changes are done to ease contact creation and form completion
from back-end, as well as reaching the speaker from chatter

- On the form:
    - If created on the fly from M2O (entering a name and using "create ..."),
      the new partner will use default values contact_phone and contact_email.
    - Once the contact is set (partner_id), contact_phone and contact_email
      are set to readonly since they change according to the partner.
    - When setting or changing the partner: this will fill all the form fields
      with new available partner data to ease the flow, but only the empty ones
      (this prevents losing previously entered information).
      If partner is a company, company name is set to the name of partner.
    - All fields are editable in the speaker section.
    - Exception thrown if no contact mean available when supposed to.
- On the chatter, about contact creation and message subscription:
    - From contact creation through suggested contacts.
	- If the partner is set but is not in the followers, it is suggested
	- If no partner is set, then there is at maximum one suggested contact
	  from track data: using contact_email if there is one, partner_email
	  otherwise. This priority serves main commit purpose. The user can
          create and edit a corresponding contact if the address is not linked
	  to a partner. It will then be searched for and set on track.

Modifies tests in test_track_partner_sync. Before, partner fields on track
would be erased by customer's ones. Now, they are updated only if empty.
Contact fields are erased by customer's ones if set. tests changed accordingly.

Task ID - 2329406
COM PR odoo/odoo#60847
UPG PR odoo/upgrade#2346

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-02 16:07:59 +00:00
nounoubensebia 9c4c953d00 [IMP] [website_]event[_sale|_track]: improve various event views & tickets deletion
Improve various event views, notably:

- Display ticket description on frontend even if there is only a single ticket
- Do not display search count on frontend agenda page when there is nothing
searched
- When performing a search, only check the text content of the track HTML
elements and not the entire HTML content, otherwise it would lead to incorrect search
results

In addition, we now also display an human readable error message when the user
tries to delete tickets that are linked to registrations.
This will help identifying the problematic tickets and remove the associated
registrations if necessary.

Task-2427778

closes odoo/odoo#64187

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-27 14:04:05 +00:00
Thibault Delavallée f3356904b6 [MOV] website_event(_track/exhibitor): move sponsor model directly into Online Exhibitors
RATIONALE

Events often have sponsors displayed on their front page. This should be
a real standalone feature of Online Event application. However currently it
cannot be used without tracks managements

PURPOSE

Purpose of this task is to allow to use and display sponsors on an Event front
page without using tracks. Moreover online and chat capabilities should be
part of a sponsor feature, located within website_event_exhibitor module.

SPECIFICATIONS

Move everything related to event.sponsor model from website_event_track
to website_event_exhibitor. Functionally feature should be the same as
before except that we should be able to configure and display sponsors
directly with website_event_exhibitor application without using tracks.

Website_event_exhibitor should also define the sponsor template used to
display sponsors below an event.

LINKS

Task ID-2326433
COM PR odoo/odoo#61781
ENT pr odoo/enterprise#14752
UPG PR odoo/upgrade#1931
2020-12-04 07:49:30 +00:00
Pierre Paridans dc95d43efb [FIX] website_event_track: only cache local & cdn based urls
This commit allows to filter out the requests to local-ish domains (cf.
the current host and an optionally configured CDN for the current
website) and preventing from cluttering the cache used by the
ServiceWorker with tracking files, scripts or other non-necessary
assets.

This allows to even further reduce the possible "opaque" requests from
being stored in the cache (as they use way more space than regular/basic
responses).

X-original-commit: 052bc7665e89426fb51928e43bd4a15dbf6cb705
2020-10-02 13:56:32 +00:00
Pierre ParidansandOlivier Dony 0e56f7ce7d [FIX] website_event_track: reuse fetch logic for prefetching urls
Before this commit, when prefetching urls if one of them fails, the
following are dropped.

This commit fixes it by handling each url seperately instead of sending
all of them to `cache.addAll()`. It also reuse the same logic as the
regular FetchEvent for consistency.

X-original-commit: 47fdfb8ae73ab79100fb83751ff0f132b4a5c628
Co-authored-by: Olivier Dony <odo@odoo.com>
2020-10-02 13:56:32 +00:00
Pierre ParidansandOlivier Dony 65c65b6c19 [FIX] website_event_track: don't clutter the ServiceWorker cache
This commit aims at reducing the requests stored in the cache by
filtering out the error-like requests (404, 500...) and the "opaque"
requests.

Also this commit adds a check for the cache size to prevent it from
filling up, resulting into a locked out cache (blocking certain
requests).

X-original-commit: ef2d323c3a029cb58ee219f06a9809aa52d108b3
Co-authored-by: Olivier Dony <odo@odoo.com>
2020-10-02 13:56:31 +00:00
Pierre Paridans 92aee2732d [FIX] website_event_track: properly match custom lang in url
In multilanguage website, URLs are automatically prefixed with the
language (beside the default language) but only the default
language-slug were supported (e.g. "en", "en_US"...).

This commit supports also customized language-slug, which can actually
be any string, for the ServiceWorker's scope.

X-original-commit: 20eddda77d0ed6f2bb9b61d8ae4194e960ccc4ff
2020-10-02 13:56:31 +00:00
Pierre Paridans b1a51bdbf4 [FIX] website_event_track: listen for pwa install event earlier
To display the PWA's install banner, the browser triggers a
`beforeinstallprompt` event when he estimates that all the requirements
for installation are fulfilled (e.g. Service-worker, manifest...).

But we have observed that the browser can trigger this event really
early in the loading of the page and even before our listener has been
registered, failing to display the banner.

This commit moves the event listener's registration out of the lifecycle
of our widget to allow it to be registered as soon as possible,
drastically reducing the risk of missed-events.

X-original-commit: a014a6c9e3baced22b158d6d8b4199bdae7562b9
2020-10-02 13:56:30 +00:00
Aurélien Warnon f3fb952ac8 [FIX] website_event_track_[session|live]: adjust event 'Youtube' layouts
This commit makes some minor changes to the Youtube video & chat layouts when
embedded in an event to ensure a better viewing experience.

Changes in details:
- Improve the "chat tab" to ensure the width is sufficient to display all of
  the Youtube chat iframe on any resolution ;
- If the video is "live" and has a chat tab, the chat is now displayed as the
  first tab (before this change, the "other tracks" tab was always displayed
  first) ;
- When displaying the next suggestion, add a covering block to avoid a
  potential flicker while fetching the suggestion to go to.

Task 2345887

closes odoo/odoo#58949

X-original-commit: 38be9fec2130f04374e378510f169a65d4bc693f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-10-02 07:26:27 +00:00
David Beguinandedi-odoo 171b83bad2 [FIX] website_event_track_online: fix agenda design to work cross browser
Before this commit, the design of the agenda was broken on Firefox, as the
'height: 0' property on td was ignored in Chrome and not in Firefox.
Probably a remnant that was not removed.

After this commit, both browser are displaying the same design.

Task ID: 2337855

closes odoo/odoo#57671

X-original-commit: c6c2dc41f818ebc30dca1682e5e2a8305dda2c67
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: David Beguin <dbeguin@users.noreply.github.com>
Co-authored-by: edi-odoo <edi@odoo.com>
2020-09-14 15:00:37 +00:00
Aurélien Warnon 961d22e4b2 [FIX] website_event_online: fix reminder button classes
This commit fixes the reminder button classes to enable/disable the right ones
as it's being clicked.

(We also fix a css rule for event colors).

Task ID 2325327

X-Original-commit 58917df45d93cd9787036582e6f745901996166c

closes odoo/odoo#56988

X-original-commit: 0c78735ba82553da2633feb48901ed8d0043c049
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-09-03 07:53:54 +00:00
Thibault Delavallée afeb20cbda [IMP] website_event_online: add common CSS for color-based backgrounds
SPECIFICATIONS

Have a common css definition for background color based on color field. This
will be used notably for track agenda and list display.

LINKS

Task ID-2325327
PR odoo/odoo#56430

X-original-commit: 92579eddda3f15eef9d759a910000374a73f4410
2020-08-31 14:01:05 +00:00
Aurélien Warnon afb6749426 [FIX] website_event_*: fix minor view/wording issues
This commit fixes a few wording and view issues, notably:
- Avoid breaking the talk description page when description is very long
- Modify all occurrences of "starts at" to "starts on" (better wording)
- Move the "hide sponsor" concept from _exhibitor to _track_online
  To be able to hide the sponsors on the "registration confirmed" template
- Hide the sponsor block in "mobile" view (breakpoint md)
- Make some minor layout adjustments

Task ID-2325327
PR odoo/odoo#56430

X-original-commit: 342799035911123b609876268a86c1da251f7645
2020-08-31 14:01:05 +00:00
Romain Estievenart 846fb4c892 [IMP] website_event_track_online: PWA's custom offline page
This page will be used in case of lost connection. The web page will be
automatically fetched when you are back online.

We also use this page when it's not possible to use the cache due to a
redirection.

closes odoo/odoo#56514

X-original-commit: a7c5cadc7467bd2c2423cd3e803cad3677961521
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-08-25 12:51:13 +00:00
Thibault Delavallée 4dcc532282 [IMP] website_event_track_online: rename Reminder to Favorite
SPECIFICATIONS

Button to add a track in wishlist is either mentionned as wishlist, reminder
or event favorite. This is due to its naming evolving during various iterations
of dev and spec.

We set it to Favorite once for all.

UPDATE

  * website_event_track_online.track_widget_reminder
  * website_event_track_session.session_topbar

LINKS

Task ID-2314778 (event online fixes)
PR #56340

X-Original-PR #56254
X-Original-Commit odoo/odoo@73619ab9f6
2020-08-24 10:20:12 +00:00
David Beguin 78300be000 [FIX] website_event_track_online: set overflow-x to auto in event agenda
In order to see the overflow-x scrollbar only when needed, overflow-x have been
set to auto instead of scroll for agenda table.

Task ID: 2314778

closes odoo/odoo#56368

X-original-commit: ec189b25230177946bca8fb2b020fb168b425c5f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-24 08:06:01 +00:00