This commit removes a savepoint call when running the event mail scheduler.
Indeed, this save point registration was colliding with the fact that we commit
the assets bundle during the reporting process, see 'commit_assetsbundle'
context key.
Since the transaction was commit during the report generation, when reaching
the end of the savepoint block, the system was trying to release a savepoint
that was no longer existing.
Indeed, committing removes all savepoints, since (quoting the Postgres doc)
"Savepoints can only be established when inside a transaction block.", which
makes total sense.
This was leading to a:
bad query: RELEASE SAVEPOINT "669516d2915811eba8d2b4d5bde7cdcc"
Aborting the whole event mail scheduler process.
As it's rather unclear why this savepoint was introduced in the first place,
we attempt to remove it. This change is done in a singular commit to be easily
revertable if ever necessary.
Task-26779
This commit introduces a new badge report displayed on a full A4 page.
This report is meant to be printed for the attendee and contains more
detailed information that the existing "badge report", which is only meant to
be folded and used as a badge.
We use a lot of custom layout and classes to create a "ticket-feeling" to the
report and make it look good visually.
We also introduce a new field that allows easily customizing (outside of
studio) this report by adding "extra instructions" (how to use your ticket /
directions on how to get to the event / ...).
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.
LINKS
ENT PR odoo/enterprise#19349
UPG PR odoo/upgrade#2599
Task-26779
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
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
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
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
Event users cannot unlink registrations. To help them in their daily job
we added an active field on registrations allowing to archive them
without unlinking them.
Task ID-2204364
COM odoo/odoo#57022
ENT odoo/enterprise#13984
UPG odoo/upgrade#1897
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
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>
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
closesodoo/odoo#65133
Related: odoo/upgrade#2126
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
Purpose
=======
Show an icon representing the state of the event mail and number of contacted
registrations instead of the simple checkbox "sent".
Specifications
==============
Instead of the checkbox "sent", an event mail can have 3 values
1. Sent, if all the mails has been sent;
2. Scheduled, if scheduled but no attendee have been contacted;
3. Running, if not all attendees have been contacted;
Note that communication targeting "after registration" are always considered
as being "running" as any new registration triggers a new communication.
A new widget is added that displays an icon depending on the state.
A new field holding contact count is added. When scheduler send emails it is
updated to keep a count of sent communications.
LINKS
Task ID-2414658
COM PR odoo/odoo#63093
UPG PR odoo/upgrade#2014
Scheduled date is not correctly triggered if event date_end changes. It should
update its scheduled communications.
Task ID-2414658
COM PR odoo/odoo#63093
In this commit we ensure calling ``execute`` method on communication schedulers
do not send emails or SMS if their scheduled date is still not achieved.
Currently only the cron method does it (see ``run``).
It is now safe to call ``execute`` directly on event communication schedulers.
Related to Task ID-2414658
COM PR odoo/odoo#68158
X-original-commit: 353bc5de9fafbc1527c382614e02438ee799c8a4
Due to ACLs it is currently impossible for event users to confirm a draft
registration if schedulers are involved. Indeed it implies updating the
scheduler which is not do-able for them.
In this commit we sudo the update of schedulers, as this is a technical
object and access is granted through registrations.
Related to Task ID-2414658
COM PR odoo/odoo#68158
X-original-commit: 73d09268922a7d242af85e36a3d81ed25ab4ca33
Otherwise it creates a lot of issues in your tests and database. Always avoid
that kind of error-prone statements in testing mode.
Related to Task ID-2414658
COM PR odoo/odoo#68158
X-original-commit: 3ad9126375e74071fec47f402f1fc63f98b755b6
* 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
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
closesodoo/odoo#65613
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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_contact_info`` compute method so that partner related fields
are independent.
LINKS
COM PR #65688
Task ID-2455165
X-original-commit odoo/odoo@dfc319f584
X-original-commit: c251048cfead27d12117557fe4b6601bef39e8e1
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
closesodoo/odoo#64187
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes the ticket sale start date to be considered inclusive.
Indeed, before this commit, if the sales of a ticket starts on the 1st of
December, people arriving on the website at that exact date will NOT be able to
buy tickets although they should be. They will have to wait for the next day to
be able to buy tickets.
A small test was added to ensure this behavior.
Task 2415917
closesodoo/odoo#63685
X-original-commit: ea6952fd7ec881b79a7294c40427ce9966997e66
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
Merge website_event_track_exhibitor into website_event_exhibitor and remove
dependency on website_event_track. That way all features related to sponsors
are now located within website_event_exhibitor.
LINKS
Task ID-2326433
COM PR odoo/odoo#61781
ENT pr odoo/enterprise#14752
UPG PR odoo/upgrade#1931
Website event track module is an advanced event module that is required notably
in some sub modules: live, quizzes, exhibitors.
When unchecking Schedule & Tracks in event settings, submodules checkboxes
are hidden. It means that currently you may uncheck module_website_event_track
while still keeping sub modules (_track_live, _track_quiz, _track_exhibitor)
checked. When saving, modules are uninstalled, then installed again if one
of sub module is still checked.
In this commit we add an onchange so that unchecking track also unchecks all
its sub modules to effectively remove them all.
Task ID-2389569
closesodoo/odoo#62027
X-original-commit: 29f12da08dbbe6037e530dcae9cf570b71894136
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The prefetching engine wants to prefetch all the registrations to all
the events of all the schedulers, which may make a lot of data.
If the autocommit is on, then all this prefetched data is discarded at
each loop.
This commit limits the prefetching to each scheduler, so that we avoid
prefetching the data unnecessarily.
closesodoo/odoo#62052
X-original-commit: 904a46f28cb64e3bd51c40dc364b256d434d1c93
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
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
closesodoo/odoo#59845
X-original-commit: fbde9dd183472237f12014315f063af736950b6c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95b and odoo/enterprise@1472202
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
Allow to configure Menu CTA button on event from event_type, like other
frontend related menus and buttons.
Add settings to ease discovering and installing sub event features like
* meet;
* exhibitor;
* live mode;
* quizzes;
LINKS
Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
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 event.tag color field from website event online to event. This field is
part of standard event models.
LINKS
Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
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
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
Avoid concatenation of translated strings & raw values and/or other
translated values, and use the new _ API (by providing the formatting
values to ensure the fallback on the english terms in case of wrong
translation).
By including the expected values inside the string to translate, we
ensure that the formatted values are included at the right place in the
resulting translated text.
This also provides more information on the string to translate to
the translators, s.t. the chosen terms for the translations can be more
adapted to the translation context.
closesodoo/odoo#54635
Related: odoo/enterprise#11925
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Bug
===
Register to an event with a public user.
Sometimes an ACL error will be raised.
Technical
=========
Before flushing the environment (after the creation of the event
registration in the endpoint `registration_confirm`), the ORM will
recompute all needed stored fields. As we didn't write on some of them
(`date_closed`, `utm_campaign_id`, `utm_source_id`, `utm_medium_id`)
they are in the list `Environment::all.tocompute`. So, the ORM will recompute
the fields even if the state didn't change (this behavior can be verify
in `BaseModel::recompute`). This is done after the "create" call of the
event registration and so without the SUDO flag.
Task-2299227
closesodoo/odoo#54624
X-original-commit: 38f37cd483b7907b20171e2c44e14e69e3e00596
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: 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>
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
_("Foo %s", bar)
to progressively migrate the code to the new syntax.
A few calls were not technically incorrect but still detected by the
linter.
_("Foo" +
"Bar")
has been converted to
_("Foo"
"Bar")
as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).
closesodoo/odoo#53683
Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))
Old syntax is still compatible but starts the migration to the new
syntax that catches error.
Prevent to unlink tickets when having registrations by adding an ondelete
restrict attribute. Otherwise billing information may be lost.
Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923
X-original-commit: 5322d76d378e4bd88a42dc0e4b01bb46c7b3546a
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
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
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>
PURPOSE
Introduce a clearer way of handling registrations for multiple events occurring
at the same time and place by
* improve attendess kanban view;
* introducing a Registration Desk menu item;
SPECIFICATIONS
Introduce a computed "payment_status" selection field, allowing to display
status of a registration, based on its SO and ``is_paid```field. It is better
fro UX and display. It is not stored as currently stored fields are sufficient
for current requirement.
Add it to the kanban view.
Prepare barcode improvements by improving _get_registration_summary returned
data dict, adding some information to display in event_barcode. Reorganize
registrations actions, and prepare a generic one leading to attendees kanban
view for registration desk.
LINKS
Task ID #2214290
Community PR odoo/odoo#47511
Enterprise PR odoo/enterprise#9190
PURPOSE
Introduce a clearer way of handling registrations for single / multiple events
occurring at the same time and place by
* improve attendees kanban view, notably by better supporting mono and multi
event (hide unnecessary information);
* introducing a Registration Desk menu item to manage multi-event mode;
SPECIFICATIONS
Improve attendees kanban view, notably due to the following issues
* event_ticket_id as char field is hard to recognize. Notably with attendees
with same ticket directly in the kanban view;
* missing explicit icon/button of the event registration state;
Handle mono-event (coming from an event) / multi-event (global attendees
view) modes.
Replace "event_ticket_id" text by colored badge (random color on each
"event.event_ticket_id.id"). Move this field directly into event as now
tickets are supported in event, not only with event_sale.
Add button or text linked to the registration state.
Kanban card structure is therefore
-----------------------
Attendee Name
Event Name (if in multi mode)
Booked by partner_id.display_name ICON/BUTTON
Ticket in a tag format
-----------------------
Buttons and icons, if registrations is
* canceled (nothing to do in Kanban, open the form view) => Canceled text
* unconfirmed and is awaiting confirmation => Attended text
* confirmed and is awaiting attendance confirmation => Button
* done, end of the flow => Icon
Mobile specific: put button as big buttons on the right of the card, ensure
all cards are displayed using same height and display correct.
LINKS
Task ID #2214290
PR #47511
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.
closesodoo/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>
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 #51503closesodoo/odoo#51523
X-original-commit: 8404a6ff12ee82e9b4ec35660f74dbe0b4a90cb0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
One condition among other to determine if SOLD OUT should be displayed for a
ticket is start_sale_date < current date. However is start_sale_date is not
set a traceback is raised.
Moreover timezones are not taken into account when comparing dates, which may
create issues.
A tool method 'is_launched' has been added to overcome this problem. It works
like the already existing field 'is_expired'. Its value is computed based on
start_sale_date and event_id.date_tz. This will be changed into a not stored
computed field in master.
Task ID 2244487
PR #51503
X-original-commit: 9f81e126cdb1ce79ef26077a708cad8a7614031f