Commit Graph
126 Commits
Author SHA1 Message Date
Martin Trigaux 22ab49e343 [IMP] *: use file_path and file_open
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed

Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.

Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException

closes odoo/odoo#135607

Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-06 14:33:43 +00:00
Pratik Raval ebe1ef4d3c [IMP] website_event_track: add location ordering in event agenda
This commit adds a `sequence` field in `event.track.location`, allowing event
managers to organize their event location as they want in the "Agenda" page.
To allow re-arrangement of the locations a bit more visible and easy, this
commit adds handle widget on track locations tree view, and removes the debug
group from the menu "Events > Configuration > Track Locations".

To match the order on agenda page and on the back-end, the same ordering
is applied at model level as well.

taskID-2942634

closes odoo/odoo#97763

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-30 18:16:06 +02:00
Aurélien Warnon bdf06ed3a3 [FIX] website_event_track: avoid showing an empty agenda
Oversight of: 129b91027700313066db0305876adcf9b2a3817d

If the view is not up to date, it will not display any agenda locations.
We need to keep the 'locations' key into the returned values for code
retro-compatibility.

Task-2942630

closes odoo/odoo#97751

X-original-commit: 6c72297e72e0936e5564f175dcb1716057e0ac4b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-09 11:32:17 +02:00
Aurélien Warnon 2cd9354700 [FIX] website_event_track: remove unused locations in agenda
This commit adapts the agenda template to avoid displaying a complete column
for a location if that location is unused for this specific day.

This allows having multiple different locations for your different event days
without cluttering the display by showing empty columns for unused locations.

Task-2942630

closes odoo/odoo#97537

X-original-commit: 129b91027700313066db0305876adcf9b2a3817d
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-08 21:02:37 +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 fc604d9334 [FIX] website_event_track: displays unpublished track warning for event manager
Correction that enables the display of the "unpublished" red label next to the
track name that are not published for the user of the group event manager only.

Task-2692907

closes odoo/odoo#86907

X-original-commit: 4d5f07dc5b393f15dc7c82e8af7da2cfeaf7720c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-22 15:16:59 +01:00
Julien Banken d369726f6a [IMP] website_event_track: update the track stage visibility logic
In the track stage model, the fields 'is_accepted' and 'is_done' of the
track stage model are not self-explanatory enough. The user may not know
that those fields will have an impact on the visibility and the accessibility
of the tracks in the frontend. We will then rename those fields and update
their use to make it clearer.

Rules are now

  * a published track is always displayed in agenda, tracks list and page
    view, whatever its state;
  * a track in a 'is_visible_in_agenda' stage (replacing 'is_accepted') is
    always displayed in agenda and tracks list. Its page view access is based
    on ACLs: aka: published = everyone, unpublished = for event users only;
  * a track in a 'is_fully_accessible' stage (replacing 'is_done') is
    automatically published when entering this stage, allowing its full
    display

This means that

  * tracks may be displayed in agenda and tracks list to public without giving
    access to their page;
  * easy way to publish tracks at once is achieved by moving them in batch in
    a fully accessible stage;
  * early-disclosure of tracks is achieved by publishing them manually whatever
    the stage;
  * easy removal of track page view is achieved by unpublishing them manually
    whatever the stage;

Page view still relies on ACLs, and therefore on published flag automatically
set when entering "fully accessible" stage.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:25 +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
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
Munaf Khan 1c2598b84c [FIX] website_event_track: fixed method not allowed
Currently, while reloading following success page
it return "Method not Allowed".

   * submit track proposal and reload
   * register for an event and reload

this commit fix this error and successfully
reload the page.

closes odoo/odoo#70087

Task-id: 2500573
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-10 05:21:28 +00:00
std-odoo 883f0a3b85 [FIX] event: the registration user should have access to the tickets
Bug
===
The registration users should be able to read the event tickets.

Allow the registration users to see unpublished event record on website
(Jitsi room, sponsors, track...).

Task 2506148

closes odoo/odoo#70615

X-original-commit: 3eef17203661919a067a4f0d8d99c2b3b6fcf233
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-10 14:24:29 +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 98f46907c2 [IMP] website_event[_track|_meet|_exhibitor]: improve various frontend event layouts
PURPOSE

This commit generally improves some of the event application layouts.

SPECS

- Add new rules to handle long text properly.
- Set a maximum height for the dropdown menu.
- Minor margin and padding adjustments.
- Reduce border radius of status badge.
- Remove the rounded corners of the cards.
- Remove the "wishlist" terminology.
- Fix the href attribute of the event name.
- Fix image distortion of the sponsor cards (backend).
- Hide viewer count when there is no viewer.
- Limiting the expansion of the meeting room aside block.
- Various other minor changes coming from user testing

LINKS

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

X-original-commit: cfbe1096ec34411a7abe9a9510dc4289e15db1cb
2021-04-12 10:39:58 +00:00
Aurélien Warnon b7b7ca38c4 [FIX] website_event_track: put partner_biography back on track proposal
Small oversight of #60847 where the "partner_biography" field was mistakenly
removed from the frontend track proposal form.

This commit simply re-introduces the field back into the form and saves it when
submitting the event.track proposal.

Task-2500455

closes odoo/odoo#69116

X-original-commit: cef6d91190de0c305c2f7a45b87717db28a9c7db
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-04-12 10:39:39 +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
std-odoo a48f5a3736 [IMP] event_*: allow Event Users to manage the events from website
Purpose
=======

Before, the Event Manager could make some action on the frontend size,
like joining full meeting room, see unpublished track...

Now, the Event User has more permissions and can create Event, Track...

So, we want also to change the logic on the frontend side and allow him
to do the same actions as the Event Manager.

Task ID-2204364
COM odoo/odoo#57022
ENT odoo/enterprise#13984
UPG odoo/upgrade#1897
2021-04-02 13:44:07 +00:00
Romain Derie f2583f3de4 [IMP] website(_*): prevent wrong multi website access during dispatch
Before this commit, routes were prevented to be accessed if the route model was
not accessible from the current website, eg you couldn't access blog1 which is
set to website2 from website 1.
That would raise a 404 even from admin/editor.

This commit introduce that behavior at a lowel level in a generic way, instead
of having to write it on every route.

Note that routes without a model converter won't benefit from this.

Closes #63499

closes odoo/odoo#64313

Related: odoo/enterprise#15688
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-01-25 11:01:13 +00:00
Nasreddin (bon) 82ca092bd1 [FIX] misc: Babel; handle 'kur' (kurdish) locale
Issue

	- add a new language with locale code KUR (for Kurdish)
	- print any report with a datetime on it (RFQ for example)

Cause

	Babel (version < 2.7.0) does not handle locale "KUR".

Solution

	If wrong locale or not managed by Babel, try to fallback
	on server default locale.
	If still wrong locale or not managed, then fallback on "en_US" as locale.

opw-2416482

closes odoo/odoo#64304

X-original-commit: e6ccdb397792db62c3b08d96435b3c1667c1aa9d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-01-10 19:59:01 +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
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
Pierre Paridans 922d81dc9c [IMP] website_event_track: allow customization of the PWA's name
This commit adds a website-specific and customizable app name for the
Events' Progressive Web Application, configurable through the website's
settings.

Defaults to '<website_name> Events'.

closes odoo/odoo#56564

X-original-commit: 423076ddf1da0fc61d9a18dc19bbbbf900e3dad6
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-08-26 09:17:12 +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 de8a5652b2 [REM] website_event_track_session: merge into website_event_track
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Move all content of website event track session to website event tracK. It
was mainly of rewriting of views and can now be safely merged into the base
track module.

Update dependencies accordingly.

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
Thibault Delavallée 1163013ed6 [REM] website_event_track_online: merge into website_event_track
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Move remaining content of website event track online to website event track.
Agenda notably is completely replaced by the new one developed within
track_online module.

Update dependencies accordingly.

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
Thibault Delavallée 0fc9e8c676 [MOV] website_event_track: reorganize module content
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_trackit.

SPECIFICATIONS

Quickly reorganize some bits of code in website_event_track module to ease
future integration of code from _online sub-modules. It also helps
understanding and finding its way through the module.

Split python files by model: notably event.track sub models inside their own
file to better follow future modifications.

Reorganize templates by main use

  * _agenda: agenda view of tracks;
  * _list: views of tracks, list-based;
  * _page: a specific view of track, page-based;
  * move side templates in side files;
  * reorganize fields and add separators as this model will soon gain a lot
    of fields;
  * reorganize controllers to separate them by main use;

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
2f47bcf24b [IMP] website_event_track_online: improve track stage management + agenda based on tage
RATIONALE

Events are sometimes held online, gathering a community. In this merge we
improve Event application to better support full-online events with improved
tracks, wishlists, chat rooms, ...

PURPOSE

Purpose of this commit is to be able to showcase tracks by announcing them
before publishing them. People may see them before event managers encode all
relevant informations and publish it.

SPECIFICATIONS: ACCEPTED ON STAGE

Add a is_accepted field on tracks stage model. Accepted tracks should be
displayed on frontend (agenda, list view) without being available in complete
view (no read access). Customers may see the track name and know what it will
be about while event managers finish to encode details of the track itself.

No field is added on track model for that. Using the stage itself is
sufficient for what it does, aka allowing filtering in frontend. No need to
add a column for that as it is not as important as published flag.

SPECIFICATIONS: DONE STAGES -> PUBLISH

When a track reaches a stage which "is_done" field is set, automatically
publish it. It allows to manage agenda creation from backend

  * accepted -> display track on website for teasing purpose (agenda, track
    list), but not accessible to non event users;
  * done -> available to everyone, published;

SPECIFIATIONS: AGENDA UPDATE

Display accepted tracks even for customers; make them not clickable, only
displayed. Manually crafting url for those tracks should still raise an
error as they are not accessible.

An accepted track is simply a track whose stage has is_accepted boolean
flag set.

LINKS

Community PR #53540
Enterprise PR odoo/enterprise#11384

Task ID-2252655 (Main Online Event task)
Task ID-2283796 (Event B2Basics / Registration Flow)
Task ID-2299857 (Event Design Review)
Task ID-2283735 (Talks -> Session upgrade)

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-08-04 14:28:29 +00:00
Jérémy Hennecart 53e4b3c83e [IMP] website_event_track: improve display after track post
When the user posted new tracks it was redirect to a page
where a message with no style. Now, after a post the user
can see the page where he was before with the form replace
by the confirmation message.

task-2198634
2020-02-26 19:52:25 +00:00
Romain Derie b997684b06 [IMP] website, website_*: improvement of 7dd70438e1
* website_blog, website_event_track, website_forum, website_mail_channel

7dd70438e1 was introduced in stable as a fix, which obviously had some stable
policy preventing some changes.
This commit improves that commit in master.

task-2119086

closes odoo/odoo#45622

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-18 16:04:11 +00:00
ryv-odoo 67c090e48a [IMP] website_event_track: improve track proposal
PURPOSE

- When creating a talk proposal, the spaces and carriage return were ignored
- Track name change from "Location" into "Room"
- Remove link between image/biography and the related partner and allow the
user to add one when submitting a track proposal.

SPECIFICATION

- Adds the plaintext2html requirement to the controller.
- Adds an input to upload an image on a track proposal.

Task ID : 2093336
PR : #43420
2020-02-04 14:48:31 +00:00
Christophe Monniez 29f02a37f0 [FIX] requirements: update library versions to match Debian Buster
Some library versions are outdated since the release of Debian Buster.

With this commit the required libraries versions will match as close as
possible the versions available in the current Debian stable release
(Buster).

Also, the requirements were tested against a Windows Python 3.7 to
ensure that a "pip install -r" can be used without the need of a CPP
compiler.

As Babel format_time now returns 'HNE' (Heure Normale de l'EST) for Fr
locale instead of the zone offset, the test is adapted.

Finally the babel.dates is explicitely imported, otherwise the proper
import of this submodule is relying on a side effect.

closes odoo/odoo#43106

X-original-commit: 32e455bf72980e6330871aa9cd99c26c6e1225d7
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-01-10 09:55:58 +00:00
Jeremy Kersten e19227d3ba [IMP] website*: clean sitemap
From now, you need to explicitely add sitemap=True if you want your controller
into the sitemap.

It's the default value, but if you forgot it, it will raise a Warning on runbot.
It will avoid wrong controller in sitemap and duplicate (empty) content.

From now, if your model contains a field website_id, the modelConverter for
sitemap will automatically add the domain:
   "[('website_id', 'in', (False, current_website_id))]"

It avoid redundant declaration and ugly url in redirect/rewrite view.

Migration: need to remove it from url_from in website.rewrite

task-2065018

closes odoo/odoo#39427

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-28 10:36:56 +00:00
Kevin Baptiste 8440964141 [IMP] website_event_track: hide hidden tags from frontend
TaskID: 2056905

closes odoo/odoo#35914

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-22 11:12:34 +00:00
Jeremy Kersten 8a0e42e8f4 [FIW] website_event_track: fix location order
Without this commit, each refresh of the agenda, will randomly show the locs.

-- Fix done in prod for oxp

closes odoo/odoo#29300
2018-12-05 08:54:19 +00:00
Jeremy Kersten ba7454eb08 [FIX] website_event_track: track.date is not required
Dont compare bool to datetime if not filled

TypeError: '<' not supported between instances of 'bool' and 'datetime.datetime'
2018-12-05 08:54:19 +00:00
Jeremy KerstenandDerie Romain 066cfc9598 [IMP] website_[blog|event|forum|sale|slide]: make website specific
Set up env & tools for module website multiwebsite (blog, event, sale..)
website_id in modelConverter and ir_rule

add _compute_domain_keys to have a different cache per website
  or rules would not be correctly website_dependant
  eg: blog 1 on website 1, blog 2 on website 2
      access blog 1 from website 1 => can access -> normal
      access blog 1 from website 2 => can access -> should crash because (ir rule)

split mixing website.published.mixin and website.published.multi.mixin to have
website_id only on last one.
 multi mixing will:
     - override website_published compute to take current_website into account (not in backend)
     - force website when clicking on published in backend

- website blog, website_sale, website_event, website_forum, website_slides are now multi website

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Thibault Delavallée b6d2351df4 [REF] mail: improve implementation of message subscribe
This commit refactors mail.thread message_subscribe method. It is done for two
purposes. First one is to optimize performance by using the new followers
computation methods introduced recently. Second purpose is to clean the API
of message_subscribe to make it simpler to use.

This commit splits message_subscribe in two main parts :

 * _message_subscribe is a private method calling the follower new
   subscription methods and updating the record set;
 * message_subscribe is a public wrapper on _message_subscribe that adds
   access rights checks;

Simplification comes by removing message_subscribe_users that was a
shortcut to message_subscribe. Having a method to subscribe partners and
channels is sufficient as we would like to avoid bloating the public API
of mail.thread. A force parameter is also removed from message_subscribe
as this implementation detail can be induced in the computation.

Various addons using the removed methods are updated in order to use the new
subscription API. They have the same functional behavior.

This commit has a great impact when subscribing several followers. In a more
general way all code using message_post is also optimized as posting a message
generally implies subscribing followers. It also improves activity use as
posting a message and subscribing new followers are common process in
activities.
2018-04-03 17:11:43 +02:00
Christophe Simonis c6b2fa47ed Revert "[FIX] base: bad back-port"
This reverts commit 0ac6043ec7.
2018-01-25 12:43:02 +01:00
Christophe Simonis da9baf2331 [MERGE] forward port branch saas-15 up to 0c97be858c 2018-01-25 11:14:56 +01:00
Christophe Simonis 0c97be858c [MERGE] forward port branch saas-14 up to 4ea4f99df9 2018-01-24 18:12:53 +01:00
Christophe Simonis 21c2f519a2 [MERGE] forward port branch 10.0 up to c0fa5228d8 2018-01-24 13:24:02 +01:00
Nicolas Lempereur 7a63d471ed [FIX] website_event_track: use event timezone
Depending on the location, on the website different timezone were used
to display tracks:

- in `Agenda` day date (as of saas-14): the current user timezone
- in `Agenda` track times: the event timezone
- in `Talks` subtitle: the event timezone
- in `Talks` tracks: the current user timezone
- in a track page: the first user (admin) timezone

With this change in all those instance the event timezone is used.

There is still a usability hindrance in the backend: the timezone used
when encoding track or event datetime is the browser timezone.

So if the browser is GMT+2 and the event is GMT+6, encoding a 4h00 time
would save it as 2h00 (in UTC) and display it on the website as 8h00.

This would make sense to encode these datetime in user timezone but
currently there is no framework option to do it.

opw-805358
closes #22427
2018-01-22 12:38:52 +01:00
Christophe Simonis b42b9c936b [MERGE] forward port branch saas-16 up to 3b7bf3a4b8 2018-01-12 18:15:23 +01:00
Christophe Simonis 3b7bf3a4b8 [MERGE] forward port branch saas-15 up to 8962b8ecc2 2018-01-12 17:23:10 +01:00
Christophe Simonis 8962b8ecc2 [MERGE] forward port branch saas-14 up to d35a76ee17 2018-01-12 16:47:12 +01:00
Christophe Simonis d35a76ee17 [MERGE] forward port branch 10.0 up to d76237e038 2018-01-12 16:16:51 +01:00
Nicolas Lempereur 491404f053 [FIX] website_event_track: day separation and tz
An agenda for an event separates tracks by days and display them taking
into account the event timezone.

But when separating by day the timezone is not taken into account and a
track could be displayed on the wrong day.

opw-803610
closes #22170
2018-01-11 12:51:54 +01:00
Jeremy Kersten 1b52b00d2a [IMP] website*: clean sitemap + add method to declare sitemap function.
Don't add useless routes or route that will return 404.
Improve generate function from ModelConverter to have a better management of
query_string.

Now we have an helper sitemap_qs2dom that will analyse the current route and
check if query string is plausible and if yes, generate a domain, when the
query_string don't seems to match the route, we return a Falsy domain.

Before this commit, if qs was /product/ipad, enumerate_page check for each
modelconverter of the route a name ilike '/product/ipad'.

Now we check all routes that contains product and one converter that match ipad
or routes that contains ipad and one converter that match product.

This commit a new way to declare the sitemap for a route.
    def sitemap_xx(env, rule, query_string):
        yield {'loc': '/my_url'}
    @http.route(..., sitemap=sitemap_xx)

    In this case, only the loc returned by this function will be in the sitemap
    for all rules.

    You can pass sitempa=False, if you don't want that route are into the sitemap
2017-09-27 21:33:49 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Xavier Morel a4ada695e1 [FIX] P3: absolute ordering removed 2017-08-19 02:34:21 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00