Commit Graph
61 Commits
Author SHA1 Message Date
Florian Charlier 9540dc7772 [IMP] event: Improve logic and appearence of archived registrations
When an attendee's registration was archived, their seat was still
considered taken, which could be problematic such as in cases of
limited seat availability.

Only non-archived registrations are now counted as seats. The same
error as with regular registrations will be raised if there are not
enough seats available to un-archive a registration. These ValidationError
messages now show the name of the fully booked event.

A few python tests are included to verify the impact of (un)archiving on
seats availability for events and for event tickets.

The appearence of archived registrations was also not different in form
and kanban views, which is somewhat confusing and inconsistent with the
aspect of archived records in Odoo. Actions buttons are not available on
archived records.

Filtering in the archived records needed to be simplified from a "Custom
Filter" to a one-click feature, already available for many models.

Task-2646298

closes odoo/odoo#77715

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-17 11:04:53 +00:00
Thibault Delavallée 7ef380fe34 [IMP] event: add precompute to remove create hook
On event model, seats_limited and date_tz are required but are editable stored
fields. An override of create has been added to ensure they have a value as
compute are called after creation which leads to required not being satisfied.

Now that precompute [1] is available this code can be safely replaced.

Performance tests (not yet merged [2]) indicate this has no impact on queries.
What was done manually before this commit is now done directly by the ORM.

[1] odoo/odoo@d04a5b5c8c
[2] odoo/odoo#81068

Task-2702872 (Event precompute)

closes odoo/odoo#80672

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-12-08 15:36:51 +00:00
Fabio Barbero 44e5f0cd2c [IMP] event_*, website_event_*: improve UI
Purpose
=======
Give the user a better experience when handling events by removing
useless views and using coherent names of fields.

Specifications
==============
Add placeholders in multiple fields, change names in event_event module
to be more consistent with each other, remove and add filters/measures
in events and tracks.

Task-2646692

closes odoo/odoo#77389

Related: odoo/enterprise#21294
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-26 19:40:39 +00:00
Nathan Marotte (nama) 07adca3c69 [FW][FIX] event : Changing seats_max could desync seates_reserved
Issue: Sometimes, when changing the Maximum (seats_max) on one of
the tickets of an event, it triggered a recompute for the other tickets

Steps to reproduce :

Install Events
Settings > Event > Enable "Tickets"
Create an event template (or use Sell Online default one) with
Check "Ticketing" and set the line price to 0
Create an event :
with that template
and Autoconfirm checked
Add a line for the Tickets:
name: VIP
price: 10
Save the event

Create two attendees for the event, one for each
Event Ticket (event_ticket_id) and confirm them (on the form, not
Confirm Attendee)

Change the Maximum (seats_max) of one ticket and save
-> the Confirmed (seats_reserved) will be recomputed but the
confirmed for the other ticket will increase as well

Side-Note:
I haven't been able to find a deterministic way to reproduce the bug
but it seems that the bug appear the most when doing all the steps at
once, and trying to not log out or refresh the page.
Also it works best on a runbot or at least with runbot data.

Without my modification, the new test passes on my local odoo server,
but fails on a dump of a runbot on my computer, adding my modification
makes it work on either case

Why is that a bug:
The recomputation seems to fail for some reason, we are setting all
the event/ticket in self to 0, but only update the value of those by
fetching a SQL query so there might be a desync there

opw-2642555

closes odoo/odoo#78023

Forward-port-of: #76492
X-original-commit: f4c936c9dc141de27a77006fb87dd2b63d88ec97
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Nathan Marotte <nmarotte@users.noreply.github.com>
2021-10-08 07:20:01 +00:00
Thibault DelavalléeandVictor Feyens 2f4d582a79 [IMP] event(_*): limit usage of search
Purpose of this commit is to globally improve code performance by limiting
search impact by

  * adding limits when only first found record id used;
  * avoid unnecessary searches when record set can be filtered instead;

Task-2638444
PR odoo/odoo#76005

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
2021-09-08 07:56:03 +00:00
Patrick Hoste ac8fd6c1c5 [IMP] event: add is_finished field in event model
PURPOSE

The is_finished computed field was added in order to avoid
displaying the booths on the registration page and warn the
user with a message.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:32 +00:00
qmo-odoo b18efd703c [IMP] event: add default communication on events
Communication on events is considered as standard: receive a confirmation
at subscribe and receive reminders. We therefore set default event mail
on both template and event models

  * event.type has default communication with 3 emails;
  * event.event has default communication when no event type is chosen. When
    a template (event.type) is chosen its configuration is more important;

Task-2488019
PR odoo/odoo#68901
2021-08-23 14:59:00 +00:00
Aurélien Warnon 1b66782dca [REF] event_*: refactor the event foldable registration badge
PURPOSE

The event foldable badge is currently not very user-friendly in terms of usage
and style.
This commit aims to re-work it visually as well as getting rid of multiple
technical flows (unnecessary fields / no studio anchors / ...).

SPECS

Preliminary cleaning : Unify both foldable badge templates into one.

The "event badges" report can be printed from 2 different sources, from the
event.event itself as a preview and from the event.registration as an actual
badge for a specific attendee.

The implementation was done using two different templates, leading to a lot of
duplicated code and potential issues when editing one template that would not
modify the other accordingly.

This commit unifies both templates into one.
When the report is printed from the event as a "preview", we simply check that
the attendee variable is missing and print placeholders instead.

Main changes : Rework the whole foldable badge template

1. Get rid of unnecessary fields

The foldable badge template used several fields on the event.event model itself
that would allow customizing the report per event.
However, there were actually no way for the user to access and edit those
fields, as they are not part of any views.

We therefore removed them (badge_front, badge_back, badge_innerleft,
badge_innerright, event_logo).

And instead offer a single new field (ticket_extra_instructions), available on
the form view of the event, that allows to easily customize the foldable badge
and adding instructions specific to this event (how to come / what to bring /
...).

2. Visual changes

The report was re-worked to make it look a bit more recent, as the previous
look was very basic and was not very attractive.

This was done using a specific scss file that allows defining rules without
bloating the template with long style attributes.

In addition, we added some pictures that help the attendee understanding how to
correctly fold the printed A4 sheet into a badge and slide it into the holder.

All the information that were previously on the report should still be there.

3. Relocate action from website_event to event

As a bonus, we moved the reporting action from website_event to event, in order
to have everything that is related to this foldable badge in the same module.

Side note: scss disclaimer

As the reporting engine does not allow complex class/rules building, we had to
implement this nice layout using very well placed background-image and
"pixel perfect" sized elements.

You will see a lot of hardcoded numbers, mainly on heights, but it can't be
helped.

LINKS

ENT PR odoo/enterprise#19349
UPG PR odoo/upgrade#2599
Task-26779
2021-07-30 09:02:52 +00:00
Debauche Stéphane d9ffbe9e89 [IMP] event: merge the SMS template and the mail template into one field
Purpose
=======
A new module "Event Social" will be added in the enterprise PR. This
new module will use a new template type, the "Social Post Template"
adding one more column in the communication tab...

We want to have only one column to select the template (Mail, SMS or
Post template) and therefor we need to use a reference field.

Technical
=========
As we can not set a domain on a reference field, we added a context key
and in the `_name_search` of the `mail/sms.template` we filter with the
domain we want if the key exists.

Links
=====
Task-2127615
See odoo/odoo/pull/46304
See odoo/enterprise/pull/7701
See odoo/upgrade/pull/848
2021-07-14 08:32:59 +00:00
nounoubensebia 89d72df22b [IMP] *_event_*: revamp event template form
This commit revamps the event template form to be similar to the event form
itself and removes unnecessary fields, purpose is to give more clarity to the
user.

It also fixes the order of the fields in the event form to be exactly
the same as in the front-end, so that the user don't get confused.

Task-2541208

closes odoo/odoo#71856

Ent-pr: https://github.com/odoo/enterprise/pull/19128
Upg-pr: https://github.com/odoo/upgrade/pull/2516
Related: odoo/enterprise#19128
Related: odoo/upgrade#2516
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-01 09:37:41 +00:00
dht-odoo 586ae4bcc4 [IMP] crm: improves description field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) crm.lead -> description
2) event.event -> note

Task Id: 2499504

X-original-commit: 524e2f089a611d897b98d86001bda5d17263db66
2021-06-07 05:24:08 +00:00
Julien Banken c2b099ef76 [IMP] event: remove the dates from the urls and the default name of the events
PURPOSE

Previously, the url of the events contained the start and end date of
the event. This link can be sent by email. If an administrator changes
the start or the end date of the event, the event will still be accessible
via the provided link. However, the user can be misled because the dates
of the url will no longer match with those set on the event. To avoid
confusion, the start and the end date will be removed from the url.

SPECS

- Remove the start date and the end date of the event from: (1) the urls
  and (2) the default name of the events.

NOTE

Note that URLs are backward compatible as only the ID is really used to
find a record through routes.

LINKS

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

X-original-commit: 60be7bb337804f2fa59003d6e5dc70ecc9750427
2021-04-12 10:39:57 +00:00
std-odoo e0c2a8a2cc [IMP] event_*: clean ACL and add a new group "Registration Desk"
Purpose
=======

Clean the ACLs related to the Event application.

Add a new group to manage the registration in the entrance of an event. This
group should not be able to modify or remove records in Event but should be
able to create and manage the registrations.

Specifications
==============

Now, there are 3 event groups

  * ``Registration Desk User``, who can manage the registrations and
    read all event-related information;
  * ``Event User`` who can create event, sponsor, ticket... His role is
    to globally handle events on a day-to-day basis;
  * ``Event Administrator`` who can create event type, sponsor type,
    ticket type... His role is to manage the way events are managed withint
    its company:

Each group implies all previous groups.

Compared to previous event users gain a lot of rules, allowing to update
records like tickets, registrations, ... Low-end event users should now
use the registration desk group.

Links
=====

Task ID-2204364
COM odoo/odoo#57022
ENT odoo/enterprise#13984
UPG odoo/upgrade#1897
2021-04-02 13:40:50 +00:00
Sunil Shrimali b5b2b55ddd [IMP] event: prevent copying kanban_state and stage_id
Currently, when duplicating an event, it also copies the stage_id and
kanban_state, which should be set to their respective default values.

This commit improves the behavior and sets the default values for
stage_id and kanban_state while duplicating an event.

taskID-2463576
COM PR odoo/odoo#67633

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-01 13:37:09 +00:00
nounoubensebia 417622d655 [IMP] [website_]event[_questions|_sale] datetimes sales start/end
changed the start/end date fields to datetime fields, in order to allow more
flexibility for the user and enable them to set a precise point in time at
which ticket sales should start/end, because otherwise ticket sales/end would
always be set at midnight which is not very flexible.

Task-2431440

closes odoo/odoo#65133

Related: odoo/upgrade#2126
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-25 14:58:20 +00:00
Thibault Delavallée 2520bfe625 [REF] event: manually update completion of mail schedulers
Purpose of this commit is to remove the "done" field computation. Indeed
it is based on either

  * mail_sent field if scheduler is global to the event (before or after
    event). This computation is light as this field changes only once
    when emails are scheduled and sent;
  * status of event registrations compared to all sent communication on
    those registrations. This is costly as adding a new registration changes

In this commit we therefore

  * rename ``done`` to ``mail_done`` to ease grep and understanding;
  * remove ``mail_sent`` as it is integrated within ``done``;
  * manually update ``mail_done`` when updating schedulers instead of doing
    it through a compute method;

Some code cleaning is performed to make it clearer and easier to understand.

LINKS

Task ID-2414658
COM PR odoo/odoo#63093
UPG PR odoo/upgrade#2014
2021-03-24 11:18:47 +00:00
Damien Abeloos 498eb0cfed [IMP] event: improve the event form editor and update the tour
* In the Communication tab, prevent inserting multiple duplicate lines
  upon switching template.
    - Before, when the user was switching between templates, the lines
      introduced with the last template were not removed, and the amount of
      lines only kept increasing.
    - Now, only the lines that are linked to a registration are kept

* In the Tickets tab, prevent inserting multiple duplicate lines upon
  switching template (Ticketing) if there was already tickets linked to a registration.
    - Same problem as in the Communication tab, multiple lines could be introduced.
    - Now, only the lines that are linked to a registration are kept

* Add 2 tests (compute mails and tickets) to ensure those behaviors are properly
  maintained in future updates. As the issue occured only in a non-saved Form when
  switching event_type templates, the tests are a little low level (since we have
  to check the computed results directly in the Form).

* Remove the last 2 steps of the event_tour :
    - They are a bit out of scope and they break the rythm (better to end on a high note)

Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
2021-03-03 12:24:55 +00:00
nounoubensebia b3d5ce3f5f [IMP] event(_sale), website_event_track: apply some UX refinements
this commit aims at refining the UX for events, notably:

- create a helper for the magic button on the event_track form, because without
  this the user won't be able to understand what the button does.

- on stage update, the kanban state will be automatically set to "gray"
  beacause when changing stages it does not make sense to keep the previous
  kanban state especially when it is set to "green" or to "red".

- make the cost of the event registration product demo data lower then the sale
  price as it is not normal to have a sale price lower then the cost.

- change the style of the "discover all our events" marketing link in the event
  reminder email template in order to make it pop a bit more for the user as
  this is an important link

Task-2451125

closes odoo/odoo#65613

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-03 13:54:40 +00:00
Thibault Delavallée adedada349 [FIX] event: fix seats_limit and configuration stored editable computed fields compute method
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_from_event_type`` compute method so that event template
configuration  related fields are independent.

Fix seats_limited being computed in sevearl method which should not occur.

LINKS

COM PR #65688
Task ID-2455165

X-original-commit odoo/odoo@3c09e86b4e

X-original-commit: ddc4ade6ad81c63efebd848ec56d197cd18e8041
2021-02-11 12:41:48 +00:00
Victor Feyens 8016591353 [IMP] event(_*): support batch creation
See merge commit for more details.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:19:04 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Thibault Delavallée fa11872330 [FIX] event: split unstored / stored fields computation
Otherwise computing unstored fields forces to compute all other already
stored fields. When being in a high charge context this may have a big
impact on DB use.

Task ID-2351463

closes odoo/odoo#59845

X-original-commit: fbde9dd183472237f12014315f063af736950b6c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 11:02:17 +00:00
Thibault Delavallée 785d98bfbe [FIX] event: fix event creation with demo tickets
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATION

Currently tickets demo data are not correctly created as they mess up with
automatic ticket computation from event_type configuration.

Solution is to flush event creation. It means tickets default configuration
is computed. Afterwards tickets are created in demo and avoid clashing with
the compute in cache.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: 6b5ec74b3d9bc008c95a92e7fa954675ae506d1a
2020-07-24 06:54:35 +00:00
Thibault Delavallée 2af57b8bb9 [FIX] event: do not erase existing tags when changing category
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

If an event has tags, changing its category resets them. We consider that
a category should update an event but not force or reset event tags, only
give default values.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: 408bad96de293dc10a3aa78fcee6159d8012fadc
2020-07-24 06:54:34 +00:00
DramixDwandqsm-odoo 188c338ab2 [IMP] website, *: make editor closer to WYSIWYG
*: event, website_blog, website_event, website_forum, website_sale,
   website_sale_comparison

We're changing most of the "DRAG BUILDING BLOCK HERE" placeholders so
that they only appear on drag. Making the preview as close as possible
to the page once saved. However, we're still keeping them on empty pages
because it make sense there to let know that the area is editable.

Part of https://github.com/odoo/odoo/pull/47933
task-2210733

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-07-15 11:36:56 +00:00
Thibault Delavallée 8385c880d2 [FIX] event: do not set a void timezone from type
Synchronize only timezone value from event type if set. Otherwise keep the
existing one or fallback on user defined one.

Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923

X-original-commit: 10094beec786ef0ea6e32e621d4e026fedeba19a
2020-06-16 09:14:31 +00:00
Thibault Delavallée b14b5b91cb [FIX] event: always synchronize tags, seats_max and auto_confirm with category
We consider that changing category should always update value of those fields
to avoid having oddly-configured events. Indeed if you choose a new event
category most of its configuration should be propagated to the event.

Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923

X-original-commit: f7e747886caebf37d60037a3e0e760f95bd0fb68
2020-06-16 09:14:31 +00:00
Sébastien Mottet (oms)andThibault Delavallée be11161a42 [FIX] event(_questions): take better care of 2many fields when updating from event type
PURPOSE

Fix various issues spotted in 13.3 when testing event. Notably
computation of 2many fields coming from template.

SPECIFICATIONS

When updating template on an event, one2many fields should be better managed.
Previous heuristic was

  * if event type uses o2m configuration (use_ticket / _schedule / _question)
    and has lines

   * erase existing lines;
   * create new lines based on old one;

This has the drawback of loosing information of what is sent (mail) or
sold (tickets) or answered( questions). Another drawback is that only
types having line are synchronized. This means that if updating several
times the event type you could end up with an XMas configuration with
lines coming from different event types, depending on their o2m configuration.

We choose a better heuristic that should solve this issue

  * every time we change type, independently of its use_* field that is used
    mainly for UX on the type itself:

    * erase existing lines that have not been used yet (no mail sent, no
      ticket linked to registrations, no answer linked to registrations)
    * create new lines based on old one; if type has no lines, event will
      have its old empty line erased as well;

It means that we try to synchronize more the type to the event while keeping
configuration line already used in some registrations.

Also provide some other fixes like deletion restrictions or better domain
for UX purpose. See sub commits for more details.

LINKS

Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923

X-original-commit: 645f70cad033083e82a3ef9102c694c331badef9
Co-authored-by: Sebastien Mottet <oms@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-06-16 09:14:31 +00:00
c5d3a109f5 [REF] ir.autovacuum: declarative garbage collector registration
The ir.autovacuum model purpose is to run several garbage collecting
operations like removing files from the filestore when no attachment
references them anymore.

The precedent strategy to register new garbage collection tasks was to
override the `power_on` method and to imperatively execute a vacuum
cleaning method on a given model. All calls were executed in a single
SQL transaction without any error handling, meaning a single fail during
any call resulted in a complete failure of the entire vacuum cleaning
chain.

We introduce a new `@autovacuum` api decorator, its purpose it to
register garbage collecting methods that will be safely executed in
their own transaction by the vacuum cleaner. In order to ensure this
new strategy is used, we deprecate `power_on` extensions.

By the way, garbage-collecting methods can be quite heavy and we don't
want users to directly call them. We now ensure they are private.

closes odoo/odoo#47842

Task: 2154079
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Olivier Dony <odo@odoo.com>
2020-05-19 13:38:19 +00:00
Thibault Delavallée 5a5eced13c [FIX] website_event: do not tell yet-to-come events are closed
Currently if an event has tickets, some of them with start date and some of
them without, it is considered has beginning at the minimal start date.
However if a ticket has no start date and is not expired, it means it is
available for sale.

An event start date is therefore the first date of its not expired tickets if
they all have a date, otherwise it is set to False (aka, already started).

We also fix display in main event page: events not yet open are not considered
as Sold out or Closed anymore, just not yet open.

Task ID 2244487
PR #51503

closes odoo/odoo#51523

X-original-commit: 8404a6ff12ee82e9b4ec35660f74dbe0b4a90cb0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-19 10:14:41 +00:00
Dharmraj Jhala ad6ea605ab [IMP] crm, event, website_crm_partner_assign: remove useless copy attributes
Editable stored fields are copy by default if their base field
allow it (char, integer, ...). Purpose of this commit is to remove
unnecessary copy=True statements added when using stored editable
fields.

PR #49464
Task 2225253

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-14 13:14:45 +00:00
Nasreddin (bon) 6290a2a9d9 [IMP] event: Remove color field from event
This commit will clean the code by removing the field
'color' from model 'event.event' since the field is
not used/needed anymore.

Task ID 2243918

closes odoo/odoo#50155

Related: odoo/upgrade#1124
Related: odoo/enterprise#10199
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-29 14:52:00 +00:00
Raphael Collet 892e3df701 [IMP] core: compute field_computed lazily
This is a simple refactoring.

X-original-commit: 634775bff6d9eba9d4548cc801071a942895a719
2020-04-03 11:40:28 +00:00
Thibault Delavallée cee2b11da2 [FIX] event_*: remove now unnecessary copy=True
Commit 397872a07f remove most onchange in event related modules to replace
them by computed r+w stored fields. At that time copy was by default set to
False for computed fields as resulting of standard behavior.

Since 4b274d3b4101fbae154a572cdf40d23838899773 this is not True anymore as we consider those fields are
duplicable. We can therefore remove unnecessary copy=True on fields to clean
their definitions.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: c6b378987bd3351deba7770b51c2a5755f7ff341
2020-04-03 11:07:56 +00:00
Thibault Delavallée bc1b5e134b [FIX] website_event: better sold out computation
Purpose of this commit is to remove some complex check embedded in templates
and replace them by a computed unstored field. It eases definition and
understanding.

Its computation has been cleaned, so that sold out appears only when tickets
are really sold out, not if their end sales date is reached. Sold out label
is displayed in both event list and event specific page views in frontend.

Small spacing issues in frontend registration form are also fixed.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: c36cf90e7b83d2424b2f52ad8a2fec0bf367e8d8
2020-04-03 11:07:56 +00:00
Thibault Delavallée b29b4bcbfc [FIX] event: ensure event_registrations_open can always be computed
Using a compute_sudo ensure this field is correctly computed (aka without
crash) if someone is allowed to read the event but not all its sub models.
For example event_registrations_open reads the active flag of a product
linked to a ticker which may not be readable by public users. This field
is used in frontend templates and therefore usable by external people.

Also remove unnecessary registrable rendering parameter in website_event
as it has been replaced by computed fields.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: b2b334a65f3a1379f25717ec39f0a52f3305b19c
2020-04-03 11:07:56 +00:00
Thibault Delavallée d2840a0519 [FIX] event: include timezoned event date_end in registration open computation
Purpose of this commit is to try to lessen random conditions being concatenated
in templates by correctly computing event_registrations_open field that is
now correctly based on

  * event.date_end -> if event is done, registrations are not open anymore;
  * event.start_sale_date -> lowest start date of tickets (if any; start_sale_date
    is False if no ticket are defined, see _compute_start_sale_date);
  * any ticket is available for sale (seats available) if any;
  * seats are unlimited or seats are available;

Some better timezone computation is included even if it could be done better.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: a11af9074499465b6dd8ad1400e60c7af96e21c7
2020-04-03 11:07:55 +00:00
Thibault Delavallée 55c8367ce7 [IMP] event: add some test for is_ongoing with timezones
Rumors were heard of is_ongoing not working well. First try with playing
with timezones.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: d54faa336da29ff3167edb2331edd3e2508bc64f
2020-04-03 11:07:55 +00:00
Thibault Delavallée 844909b0f1 [IMP] event: improve backend views and help strings
Embedded tickets view: improve labels, start and end dates are now labeled
Sales Start and Sales End when having sale installed.

Help are added on event_registrations_open and start_sale_date to clearly
define what they mean.

Some linting is also performed to ease readability, notably some computed
fields reorganization to have them ordered by group like fields.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: e2deabc451aa2d62365b1e1b43ea3947907d2648
2020-04-03 11:07:55 +00:00
fja-odoo 388c222c6c [IMP] base, *: allow html fields not to sanitize forms
* = event, website_event_track, website_sale, website_hr_recruitment,
website_livechat, website_sale, website_slides

The option to sanitize or not the forms was not available, this will
allow better flexibility on whether forms should be sanitized or not on
an HTML field.
Also we use this new param to allow forms to be added on some already
existing html fields where forms where sanitized out.

task-2209554

closes odoo/odoo#47318

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-31 14:22:43 +00:00
Patrick Hoste d2e02976e2 [REF] (website_)event(_sale): change seats_availability field to seats_limited
PURPOSE

Change seats_availability selection field into a boolean field
and rename it to seats_limited for consistency.

SPECIFICATION

Change all the tests accordingly.

Task ID : 2198660
PR : #46659
2020-03-31 06:34:45 +00:00
Patrick Hoste aebe199d80 [IMP] (website_)event(_track): change event form view display
PURPOSE

Change the event form view to improve its usability and make it clearer.

SPECIFICATIONS

- Change some stats buttons icons
- Change order of the fields and put the range date field in second
place since it's a mandatory field.

LINKS

Task ID : 2198660
PR : #46659
2020-03-31 06:31:08 +00:00
qmo-odoo 91eded2eb2 [IMP] website_event, event: Add event.tag.category and event.tag + rename event.type display name
This commit changes the display name for the model event.type from
"Event Category" to "Event Template"

This change was needed before introducing the new model event.tag.category
which will be used to group tags (event.tag)

This commit introduces two new models: event.tag.category & event.tag

The tags will be grouped by category and will be used to filter events.

In the front-end, if the user activates the "filter by categories", each
event.tag.category will generate a new dropdown of related tags.
Clicking on one of these tags will add a new "tag badge" above the events
(same way as in eLearning).

LINKS:

TaskID:2162438
PR: #43856
2020-03-26 14:59:16 +00:00
Thibault Delavallée 45f32c5795 [REF] event: rename event type default_registration_max to seats_max
Purpose is to have matching names between event type and event to ease code
understanding.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
Upgrade PR odoo/upgrade#912
2020-03-10 11:15:10 +00:00
Thibault DelavalléeandMichaël Mattiello 5e4efef3ca [REF] event : move from onchange / default to stored editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: REQUIRED FIELDS

As computed fields are computed after create required attribute cannot be
respected without computing them beforehand. That is why we have some custom
code to compute required fields if not given at create and update the creation
values accordingly.

SPECIFICATIONS: MAIL SCHEDULING

Mail scheduling on event type is modified in this commit. Previously checking
the use_mail_schedule radio button had no effect on event_type_mail_ids field.
It is now reset if unchecked. It is therefore coherent with use_ticket and
event_type_ticket_ids field behavior.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Michaël Mattiello <mcm@odoo.com>
2020-03-10 11:15:09 +00:00
Thibault Delavallée 456f8a7e70 [FIX] event: fix seats computation when creating an event
Dealing with newId is sometimes difficult.

closes odoo/odoo#46560

X-original-commit: 416d5ae6f7753c413b6981f9de3d24913943e9c2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-28 12:59:26 +00:00
Thibault Delavallée a6acb077e4 [FIX] event: fix attendees (seats) computation in transitional mode
When being in edit mode attendees count may be reset temporarily to 0.
Indeed when user change the event_type linked to the event it triggers
the computation of seats. Among those fields seats_expected is used to
display the attendee count in event form view.

In this commit we rewrite the computation in order to work in onchange mode.
It correctly update record in cache instead of rebrowsing event in a compute
and correctly support newid by checking _origin id.

This behavior is probably present since a few versions but as it is not
critical we target the last stable-saas.

closes odoo/odoo#46444

X-original-commit: f858f0432abc97a805e24674990acac510b45e9d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-27 13:16:12 +00:00
Debauche Stéphane 9b55dfcc35 [FIX] event: fix and provide a default value to kanban state
In the event form view, when only community is installed, kanban state
is not on the right part of the form.

Moreover it should have a default value.

Task 2188857
PR #44545

X-original-commit: 1813f064bdcbc09131197484ed3c075dcba8bcb7
2020-02-18 15:59:12 +00:00
Patrick Hoste 1de3d44013 [IMP] event: remove seats_min and default_registration_min from event model
PURPOSE

This field is deprecated. Since its usage was to trigger a warning when
trying to confirm an event and confirming an event is not done anymore,
it has become obsolete.

SPECIFICATION

remove seats_min field and usage from event.event
remove default_registration_min field and usage from event.type

LINKS

Task ID : 2192652
PR : #44938
2020-02-18 14:14:46 +00:00
qmo-odoo b0ec3aa1eb [REF] event: remove twitter_hashtag and its configuration on event type
This commit removes the field twitter_hashtag from event and event_type.
The justification behind this change is that it has been made obsolete
by our social marketing app and our website builder.

Task ID 2191921
Community PR odoo/odoo#44715
Upgrade PR odoo/upgrade#764

Related: odoo/upgrade#764
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-11 14:36:52 +00:00