Commit Graph
348 Commits
Author SHA1 Message Date
dane@odoo.com a98717b0e5 [IMP] event: refactor barcode
Commit is responsible for refactoring
code related to barcode.

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com 0e9a9aff46 [MOV] event_barcode: integrate into community event module
event_barcode is moved to community and integrated directly into
event module

task-3411827

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
Thibault DelavalléeandJeremy Hennecart 643df62f12 [REF] event: merge phone and mobile fields on registration
RATIONALE

Merge two phone-related field on registration as they overlap. Having only
one is sufficient for contact-oriented model like registration.

SPECIFICATIONS

Registration model currently holds two phone field, phone and mobile. This
leads to having records with sometimes phone, sometimes mobile being filled.
This makes phone flows not easy: we have to define fallbacks (use phone or
mobile), data is not always synchronized, ... in the end what event users
need is one phone field to be able to communicate with attendees. Having
only one field is sufficient and simplifies the model.

Keep only one phone field, instead of two. Merge phone and mobile into a single
one, keeping phone as first value when having both available e.g. when
synchronizing with the partner.

Task-3366899

Part-of: odoo/odoo#128232
Co-authored-by: "Jeremy Hennecart" <jeh@odoo.com>
2023-09-27 17:40:55 +00:00
Noe Antoine 1da6cbc4c8 [IMP] event: redesign badges with multiple formats
Before, event badges were an a4 page divided in 4
quarters, meant to be foldable into a single badge.
It contained folding instructions, event instructions
and was white mostly everywhere.

We want to introduce some customization to allow
different colors between ticket types and a background
image.

Therefore, we introduce 3 different formats to print badges
(also sent to attendees through event communication)
- a4 foldable (french fold) (~ previous one but redesigned)
- a6
- a4 4 per page

The templates are intensively redesigned to a new style.
New templates are introduced to match new formats.
Example tickets are still managed, printing an appropriate
example ticket according to the event format.
Printing several event example tickets will still use each
event format appropriately

Models:

- event.event receives a selection field badge_format
and an image field badge_image. This will be printed
on the background of badge cards.

- event.event.ticket receives a color char field. It
can be picked from the event form view with a color picker,
and will be the backgroud of a band on the bottom of badge cards.

Renaming:

Scss file, records and templates are renamed from "_foldable_badge"
to "_badge", as now badges are not always foldable. Namespaces
of selectors follow the same logic. We still have specific
styling for the foldable version so there are still selectors
using a 'foldable' name.

Task-3473293

ENT PR: odoo/enterprise#46163
UPG PR: odoo/upgrade#5126

closes odoo/odoo#132855

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-09-27 14:56:56 +00:00
Mayurrajsinh Rathod 7daff81041 [FIX] event: prevent scheduled communication for inactive events
Prior this commit:
The mail scheduler of the event notifies the attendees even when the event is
no longer active.

After this commit:
Inactive events no longer notify attendees.

Task-3381876

closes odoo/odoo#136429

X-original-commit: b61ece38a29e63f77daa638472228caa063d26e6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-25 15:20:21 +00:00
Thibault Delavallée 59652b25e0 [IMP] various: support multi-emails in mailings
PURPOSE

Be defensive when dealing with email fields, notably when having multi-emails
or email field containing an already-formatted email.

SPECIFICATIONS: MAIL COMPOSER IN MAILING

When using the composer with a mailing, it currently skips recipients whose
email is a multi-email due to the strict usage of 'email_normalize'.

We can improve multi-email support by effectively checking for the first
email found, using the "less strict" mode of normalize. It means more emails
are detected as valid, and therefore sent.

Due to lower support of multi-emails when sending emails, this even allows
to send multiple emails as all emails are mailed.

SPECIFICATIONS: DEFAULT RECIPIENTS

Mailings are generally done using default recipients, aka using a model method
that returns the people to mail: customers ('partner_id'), customer emails
('email_from'), specific implementation, ...

This is implementation using '_message_get_default_recipients' that returns
'partner_ids', 'email_to' and 'email_cc' that are then used in the mail
composer to generate final recipients.

In this commit we better handle the content of email fields to avoid issues
with multi-emails. For that purpose we correctly split the content of those
fields. We now have several 'email_to' for records having multi-emails instead
of a single badly-formatted 'email_to'.

Task-2612945 (Mail: Defensive email formatting)

X-original-commit: odoo/odoo@4a0d87d44f
Part-of: odoo/odoo#134934
2023-09-11 15:22:09 +00:00
Thibault Delavallée 9b33fa5627 [IMP] various: support multi-emails in '_message_post_after_hook'
PURPOSE

Be defensive when dealing with email fields, notably when having multi-emails
or email field containing an already-formatted email.

SPECIFICATIONS

Post-message hook is used in various apps to link records to a newly created
created partner. This is the case notably when used with a template as it
creates partner on the fly based on emails to always handle partners.

We now check either the complete 'email', either the normalized version of
it to avoid comparison issues with multi emails and formatted emails. As
'email_normalized' now supports multi-emails by storing the first found one
it helps finding the partner.

Task-2612945 (Mail: Defensive email formatting)

X-original-commit: odoo/odoo@e5ad9e0371
Part-of: odoo/odoo#134934
2023-09-11 15:22:09 +00:00
Noe Antoine 72b0d77cb5 [IMP] {website_}event{_sale,_exhibitor}: ease ticket access
The tickets are reworked, made easier to print and have
their structure reworked for qr code addition (in ENT branch).
Also they are easier to download as buttons are added to do so.

1. Design

Tickets have their background removed in order to ease
their printing. More room is given to details, the design
is simplified.

  New RESPONSIVE HTML TICKET

The confirmation email will now contain a link "See tickets"
leading to a new version of the full page ticket, called
"responsive_html". It does not generate / download PDF but rather
leads to a rendered qweb html page, with design working
properly on different screen sizes. The design is a tweaked
version of the full_page ticket template, simplified. It allows
users to see their ticket directly without needing a pdf viewer.

2. Download Tickets Buttons

"Download / See Tickets" Buttons are added in
- Email Templates (Ticket and Badge)
- The SO confirmation (if payment). All tickets, per event.
- The registration confirmation (if no payment). All tickets
in the same PDF. They are for the same event.

In order to access tickets, a route event/my_tickets is added
in the controller. It takes an event_id, registration_ids and
a hash based on those plus the database secret using tools.hmac.
The groundtruth hash is obtained for given registration ids in the
method _get_tickets_access_hash on event.event. The route is
used in all places listed above. The hash must be valid and attendees
must exist.

No condition on payment is set in my_tickets as we want the download
tickets link to work for non-free tickets as well at the end of the
sale process, and as the sale order could not be linked to any invoice
at that stage (if automatic invoices is not set in the settings),
registrations being 'not paid' at that point. This could be cleaned
in further work as different states are to be clarified.

The route must be public as it must work even for public users.
(from email or as public user registering on front-end) Also,
we give sudo access to the course in the case of invitation to
a course that is not yet published, as long as the hash and
registration are valid.

3. Email Templates

In order to have similar mail templates for badge and tickets,
Registration Badge content is duplicated from Registration
Confirmation and slightly tweaked, replacing existing body.

Also, the info of the payment / order moved from full page ticket
to the body of the confirmation email.

PR ENT - odoo/enterprise#41164
PR UPG - odoo/upgrade#5007

Task-3061851

closes odoo/odoo#120933

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-07 09:00:17 +00:00
amdi-odoo 85a4d44c9a [IMP] {website_}event: improve registration desk view
Purpose
=======
Registration Desk promenade.
Bunch of QOL improvements to make the handling
of events easier.

Specification
=============
- Modify the attendee search template to have the search
  in this order:
 * Participant (search in name, email and company)
 * Company
 * Booked by
 * Selected Answers
 * Ticket
 * Event (Just for the multi-event mode)
- Make attendee registration status bar clickable to ease
the state modification.
- Attendee registration kanban view improvements:
 * Display the company.
 * Add a ticket icon in front of the ticket type.
 * Display the answers selected while registering (only
   for the questions of type selection) as tags.
 * Always use the fa-check icon for the card buttons
   (secondary for confirmed, primary for attended).
 * Add a button to go backwards (confirmed to unconfirmed,
   attended to confirmed) to ease the state modification
   from the kanban view. As we now have 2 buttons, widden
   their allocated space to make the clicks easier.

Task-3469490

closes odoo/odoo#134479

X-original-commit: c95db124cac8031e928f8fcdc5d47ebbc7f7f341
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Amélie Dieudonné (amdi) <amdi@odoo.com>
2023-09-07 06:56:52 +00:00
Noe Antoine c0a68becb5 [IMP] event: add a lang field on event.
In order to allow all communication to be sent in
a chosen language, a 'lang' field is added on the
event.event model. If set (amongst the installed languages)
this language will be used to translate email templates
instead of the partner's one (which is still the default one)

The field is added on the event form view.

Task-3357099

closes odoo/odoo#127540

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-08-23 14:43:11 +02:00
althaf shaik f16b92a8af [FIX] event: handle error in res partner while evaluating static map url
This traceback raises when user click 'send by email' of 'event registration'.

Error: 'Expected singleton: res.partner(20, 19)'

On '_compute_static_map_url_is_valid' method self is referenced to get
'static_map_url'.
when self is having multiple records, it is used to get
'static_map_url', which leads to above traceback.
See:
https://github.com/odoo/odoo/blob/6f45bf0f496db37b28e8c4f8cc23b0eeec683c90/addons/event/models/res_partner.py#L32-L40
sentry-4359170170

closes odoo/odoo#132560

X-original-commit: 1da387373f772c487fa7391aa24be57b464bb5f3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-21 19:57:46 +02:00
Gorash 75a105f46a [REF] base/all: Update modifier syntax: remove 'states' from fields
These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.

During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').

Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.

Part-of: odoo/odoo#104741
2023-08-18 09:49:11 +02:00
Thibault Delavallée adfdf5ab33 [IMP] phone_validation: add a phone formatting tool on model
RATIONALE

Simplify field management for mail / phone / sms flows. Make it working out
of the box, easier to use and tweak.

SPECIFICATIONS

Add a '_phone_format' tool method on BaseModel. It allows to format a number
either directly, either from a field available on the model. It allows to
ease number formatting. It uses available helpers to find numbers using
'_phone_get_number_fields' and '_phone_get_country_field'. With default
generic behavior this allows to simplify most calls to phone number formatting.

Having it available at BaseModel level allows to remove some custom code,
calls to phone_validation API, ...

Task-3422449 (Mail, Phone: Move and improve field helpers)

Part-of: odoo/odoo#130468
2023-08-02 18:50:17 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Thibault Delavallée e2711f46ff [IMP] event: format mobile / phone number of attendees when possible
ISSUE

SMS reminders are not always correctly sent, as people fill form using local
numbers. When scheduler run the number is not always recognized to be
formatted using E164 format. We should try to normalize numbers when possible.

SPECIFICATIONS

Try a sanitize: format number based on event country (or partner if set).
If formatting it works, use the given number, otherwise use the original
number.

Do it at registration creation, as classic flow is the frontend where customers
give numbers used to create registrations. When the number is coming from the
partner through the compute, do not do anything and keep current behavior
which copies partner number if not given directly on the registration.

Add an onchange to try to format the number in the form view, like what is
done on leads. Do not automatically do it at write as it is not really
required currently from business point of view, it is more an helper for
frontend registration.

Task-3342820

closes odoo/odoo#128118

X-original-commit: 94fa8d962535a754c9fb26997a38cc8b51b8974e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-12 12:38:48 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Saurabh Choraria 93b7463113 [FIX] event_sms: check model of sms template
When notification type is set as sms we need to check whether the template
which is referenced is coming from a correct model or not.

Applying this commit will fix this issue.

sentry-4195133685

closes odoo/odoo#125831

X-original-commit: 745bcab5ee524ae1c42e5773a86b15ef3a7019d3
Related: odoo/enterprise#42882
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-06-21 06:57:53 +02:00
Nasreddin Boulif (bon) 7359b47a81 [FIX] event[_sms]: send emails direclty after attendee confirmation
Steps to reproduce:

  - Install `Events` module
  - Create a new event and set it to `Autoconfirmation`
  - Create a new attendee and confirm it

Issue:

  Mail that confirm registration is not sent to attendee.

Cause:

  When computing the `schedule_date`, it take the value of the
  `registration_id.create_date` WITH the microseconds.

  When creating a new attendee, at some point we run the mail schdelure
  that compare if the `schedule_date <= now`.
  `schedule_date` and `now` have same value except for the microseconds
  (set on `schedule_date` but not on `now`).
  Therefore `schedule_date > now` and the mail is not sent.

Solution:

  Remove microseconds from the schedule_date.

opw-3079389

closes odoo/odoo#122188

X-original-commit: f2adca45dcec5a11daa92d07bae00615210ea0de
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-05-24 17:05:46 +02:00
Patrick Hoste 6b8daa880c [IMP] website_event(_sale): adds new identification questions
This commit changes the way the identification questions (name,
email, phone) are asked when registering to an event. They aren't
hardcoded anymore and can be created per event the same way other
questions can be. They can be set as mandatory or not and the order
can be changed. One can now also ask for the attendee company name.

Task-3056380

closes odoo/odoo#112164

Related: odoo/upgrade#4313
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-05-12 21:50:44 +02:00
Patrick Hoste cc60fcd45c [MOV] website_event(_crm)_questions: move event questions code
This commit moves the code from website_event_questions to
website_event and from website_event_crm_questions to
website_event_crm module.

Task-3056380

Part-of: odoo/odoo#112164
2023-05-12 21:50:44 +02:00
Ivan Yelizariev 547274edd1 [FIX] event: properly handle non-existent template
This commit modifies `execute` method to avoid `MissingError` on reading
`template_ref` field.

`template_ref` is a Reference field, which may have id of a deleted record.

https://github.com/odoo/odoo/blob/927890d0178c361ef8d80fe6a1ec2ffaefaf73fd/addons/event/models/event_mail.py#L53

Method `execute` is used by cron.

https://github.com/odoo/odoo/blob/fba13477843d4d36e3e7a9ddd4b0812c9726e20c/addons/event/data/ir_cron_data.xml#L4-L8
https://github.com/odoo/odoo/blob/927890d0178c361ef8d80fe6a1ec2ffaefaf73fd/addons/event/models/event_mail.py#L247-L256

Getting the `MissingError` means blocking processing the whole batch of tickets.

Fix it by ignoring such tickets and logging a warning

https://online.sentry.io/issues/4089773378

closes odoo/odoo#121199

X-original-commit: c61a8fbb7d4338ca362a3d2093e7aa2f973b289c
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-05-12 19:55:10 +02:00
Rémy Voet (ryv) 302c7baa87 [REM] core,*: remove name_get_uid parameter from _name_search.
`name_get_uid` is unused (at least since v14) and the
documentation about it, is wrong.

closes odoo/odoo#117819

Related: odoo/enterprise#39483
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-04-28 16:04:27 +02:00
D J 50d6f18250 [IMP] website_event: consider address while searching events
Currently, website users/visitors are not able to search the events based on
where they happen.

This commit improves the behavior by allowing the users/visitors to type the
city/country name in the search box and returns the events that are happening
in the country or city that matches the search term. To allow this, we have
utilized the search_extra search option and searching the matching events
with sudo because public users can not access the address_search m2o of the
event. Apart from that, this commit also adds the ability to address_search
the event based on location (name) of the address on address_search.

Note that searching with sudo is just to add event ids in the domain. The final
result will be returned with non sudoed environment and so the record rules are
always respected.

TaskId-2791031

Part-of: odoo/odoo#89796
2023-04-05 09:42:23 +02:00
Hansun (hale) 6a54992575 [FIX] event{._sms}: event: access right for admins of event app
1. Install [Events]

2. On [Settings], create an admin for Events (uncheck all other rights)

3. Click on Events, enter an event

3. Click on [Communication] tab, and try adding a line

Issue: accessing ir.model is blocked
Solution: Find another way

Original fix in 15.0: #112527
Fix of the fix in 15.0: #115881
Original forward-port in 16.0: #115101

This commit is fixing the original forward-port in 16.0 and includes
the fix of the fix.

affected branch: 16.0-master
opw-3163138, 3193659

closes odoo/odoo#116438

X-original-commit: 38594f13586d95c8ed74593ea368e8b51826740b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-24 07:45:15 +01:00
Hansun (hale) 5f6c758adb [FIX] event{._sms}: access right for admins of event app
1. Install [Events]

2. On [Settings], create an admin for Events (uncheck all other rights)

3. Click on Events, enter an event

3. Click on [Communication] tab, and try adding a line

Issue: accessing ir.model is blocked

Solution: Find another way

Impacted versions: 15 - master

opw-3163138, 3103199, 3193659

closes odoo/odoo#115237

X-original-commit: db37a4e230f8cd6ac916fe3a21aea5ff43c61d53
Related: odoo/enterprise#38169
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-14 19:39:09 +01:00
Raphael Collet c161177cb7 [IMP] core: _name_search() now takes explicit order and limit parameters
This API is much more sensible for making subqueries.  Specifically, one
can generate a subquery without the clauses LIMIT and ORDER BY.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 136eb34f07 [IMP] core: _search() no longer uses a default order
This simplifies the use of subqueries by avoiding some costly default
order on the model or the idiotic order='id'.  Method _flush_search()
has been adapted accordingly.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
miad-odoo f1cb5e6b39 [FIX] event: make scheduler respect mail template
Before this commit, the mail scheduler in event bypassed the email_from field
in the selected template, implementing instead its own logic.

With this commit, the scheduler respects the `email_from` field from the mail
template, and only implements its own logic if that field is not set.

Task-3092425

closes odoo/odoo#111462

X-original-commit: ef503e62480c774e8a0d193666cc4cce5ab90282
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-31 15:17:55 +01:00
Renaud Thiry 1348509668 [IMP] event: add setting menu for g-map API key
Add some setting buttons for users to configure their API keys in events

task-3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Renaud Thiry 83e4551492 [FIX] event: add signed static maps api
Google now requires an API key for the static maps API.
As API calls cost money, and we cannot restrict the domain of the caller
with the API key in emails, as the domain may vary vastly,
the signing of static API URLs is implemented in the existing
'google_map_img' of partners.

This in turn can be used to get a url for an existing location.
While preventing anyone from stealing the API key for their own purposes

task - 3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Thibault Delavallée 1a1acabd7b [REF] mail: cleanup mono/multi record composer behavior
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Support a real res_ids field on mail.compose.message model. Instead of relying
on active_ids from context, store it once for all at composer level and use
it in code. Active_ids usage is still done at default_get level, using it to
populate the field.

Improve usage of domain, renamed to res_domain to match other document related
fields naming. Add support of a res_domain_user_id field allowing to set the
user from which the domain should be evaluated.

Composer now runs on a list of IDs. Mass mail mode and comment mode are now
distinct from running on a singleton or on more records. Rendered or raw
mode is not triggered by

  * mass mailing mode: always display raw mode, whatever the number of records;
  * comment mode: display rendered mode when having a single record (like the
    previous comment mode). Display raw mode when having either no records
    either at least two records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:39 +01:00
Renaud Thiry f039f57eb8 [IMP] Add more detailed default email subjects from chatter
All emails sent from the chatter start with "Re:" followed
by the name of the record. The name of the record alone is sometimes not enough for
the followers to understand what the mail is about.
Additionally, "Re:" does not make sense when starting a conversation.

This commit gives better default subject
for event registrations and allows thread models
to override the default subject of messages.

This also removes "Re:" from default mail subjects.

Task-2833215

closes odoo/odoo#95817

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-01-05 15:36:53 +01:00
Pratik Raval a0a6171378 [IMP] event*: move event type data to demo
* = event, event_booth, website_event_questions

We used to provide data for the event templates (event.type) to provide a basic
configuration to play with. However, they are not much helpful, and sometimes
can confuse the users.

This commit removes the data records for the event templates, and on the
m2o field on event, now we let users create/edit them on the fly so that
they can explore the feature by themselves.

We have also added demo data to the 'Exhibition' and 'Sport' templates,
having booths and questions, respectively. Along with that, we have added
relevant data to the demo events where both templates were used; and set
auto-confirm to be false by default when creating a new event template.

taskID-2854123

closes odoo/odoo#99421

Related: odoo/upgrade#3849
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-02 12:56:21 +01:00
Noe Antoine a340443177 [IMP] event{_sale}: add sequence to tickets (and templates)
When the price and the event are the same, nothing allows
ordering tickets in event_sale. Therefore, add a sequence
number and handle widget to the tickets (in data as well).
Also do it for ticket templates. Also, order the tickets
(on events and templates) by name before id.

Since event type tickets are not linked to any event, the
order does not include the event_id. However, event event
tickets are, and if they appear in the same list / reporting
someday, it makes sense to order them by event_id first.

In event_sale, we make sure the price is also in the order.
As the price is in the copied fields on the event when
using an event template, we add the price on the event
type tickets ordering to align with the event event tickets.

Add default value to sequence and sequence number to data
for event.type model. They were sequenced but demo data had
none, hence not really ordered.

We also add the id in the event.event _order value, otherwise
when ordering on the event (for instance ordering on event_id
for event.event.tickets), the order is random for events
having the same date_begin. We prevent this from happening.

Also make description optional hide on event types.

Task-2997391

closes odoo/odoo#101384

Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
2022-11-17 14:56:42 +01:00
Jérémy Hennecart (jeh) 4fa73dc531 [IMP] website_event: round default datetime
Add default date_begin and date_end when creating an event.
To avoid having weird time (like 11:23) we round date_begin
to the nearest 30 minutes range and the date_end is set to
the next day of date_begin.

So for example if now is "2022-06-30 10:12" then:
date_begin = "2022-06-30 10:30" and date_end = "2022-07-01 10:30"

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:04 +02:00
Umesh Gupta e8949d9f79 [IMP] event: prevent communication line duplication on an event
Currently, when we change the event template, all the communication
lines linked with are added to the event. That means, even if some of
the lines are sent, and if the new templates lines that has exact same
configuration than the sent ones, they are still added to the event,
which means the same mails will be sent again to the attendees.

With this commit, we check that the communication line being added
(as a result of template change) has the same configuration against
any of the already sent one, it is skipped. As a result, attendees
will not be spammed with the same emails.

taskID-2811310

closes odoo/odoo#89961

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-16 16:27:52 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Miquel Raïch 055f95ddfe [IMP] event: use UserError in search method instead of ValueError
In a search method, the error comes from the user and thus the error should be an UserError. ValueError should be used for other cases.

closes odoo/odoo#93944

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-27 15:11:09 +02:00
Ivàn Todorovich db45e228a8 [FIX] event: do not fail if mail.template is missing
Steps to reproduce:

1. Delete the mail.template "Event: Registration Badge".
2. Go to any event.registration record.
3. Click on Send by Mail button.

closes odoo/odoo#93090

X-original-commit: 373a838d2df05b8be9a89a933b291492ba6052f0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 15:46:08 +02:00
Patrick Hoste 312c4a5218 [FIX] event: fix address search
Fix commit : https://github.com/odoo/odoo/commit/b309200de582b388b35314512b4cbcd5316760c0
by changing address_seach field from related to computed.

Task-2810400

closes odoo/odoo#92789

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-02 16:54:37 +02:00
Florian Charlier a0e7f69513 [IMP] event{,_sale}: unstore seat fields
With stored computed seat attributes, the database can be flooded with update
queries for the stored values for the event (ticket) seats computations (such
as reserved, expected, and available seats).
This can especially occur when a communication is sent to many people about
an event with a registration link, many users may want to register at the same
time, possibly resulting in concurrent_update errors.

In this commit, we remove the `store=True` attribute of those fields, and
therefore remove the Reporting/Event feature depending on them and rewrite some
domain searches and _compute fields in the event and event_sale modules.

This also impacts the way constraints are enforced on the number of
registrations vs defined maximum as no stored value is directly available.

For performance reasons, all events and tickets are now shown on backend form
views, with seat availability added in their displayed name.

Misc
To avoid delaying the inevitable, the Event configurator modal/wizard now
validates event/ticket consistency at closing.

The UI of the RegistrationEditor wizard is also improved:
* A warning alert will tell users that free registrations were not confirmed
because of insufficient seat availability.
* A first step to better explain the consequences of the actions taken on the
modal was to be taken, here via the description and buttons wording.

Tests
Query counts are (indeed reduced) and updated. However, as local testing with
`test-tags=/test_event_full` ("tef_only") is currently not reliable, these
values were updated by applying the same change from the commit as the one seen
for the runbots, while a "?" is appended to show this uncertainty.

Task-2654816
See odoo/upgrade#3118

Part-of: odoo/odoo#81583
2022-05-31 13:57:24 +02:00
Patrick Hoste b309200de5 [IMP] event: allows filtering event on address
PURPOSE

This commit allows one to filter the events based on its address

LINKS

Task-2810400

closes odoo/odoo#87678

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 12:51:50 +02:00
Raphael Collet 6cf8db906f [REF] *: adapt code to new flush API
closes odoo/odoo#87527

Related: odoo/upgrade#3497
Related: odoo/enterprise#26939
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-05-25 18:00:47 +02:00
Christophe Monniez 65c8814a2f [FIX] various: replace deprecated currentThread method
CurrentThread is now really deprecated in Python 3.10 ... Time to
change.

Part-of: odoo/odoo#91927
2022-05-23 08:29:52 +02:00
Pierre-Yves Dufays 909d577918 [IMP] event: eases registration follow-up
Globally ease event registrations followup by improving the related search
views and by allowing a quick access to statistics.

Specifications:

1) A stat button has been added on event that go to attendee reporting filtered
on the event

2.a) in the attendee reporting, the text search has been modified as follows:
- order: first search on event
- order + added: then search on responsible
- order + added: then search on organizer
- order: then search on participant
- then other field already present

2.b) still in the attendee reporting, filter "archived" has been moved as the
last filter

2.c) still in the attendee reporting, group by for campaign, medium and source
have been added

3) link to confirmed and expected attendee in the kanban view box now redirect
to the new stat view with the suitable filter

Technical remarks:
- view for a specific event launched from the event view uses a specific
search view which doesn't include search on event (name, organizer, ...).

Task 2761011

Part-of: odoo/odoo#84546
2022-04-29 11:00:50 +02:00
Pierre-Yves Dufays 5717543b04 [FIX] event: fix event description edition (leak from one to another)
When saving a description the one edited doesn't appear but the one edited
previously instead. This fixes this problem.

Technical note: the default description for a new event was the rendering of
a template. That template was shared between all the events and overridden each
time.
The solution was to strip the identity of the template while rendering it
making it a constant and preventing it from being shared between events.
This could be done by setting rendering_bundle to True in the rendering context
(unfortunately, t-ignore is not a legitimate attributes of template tag).

Note that the same fix [1] was done on `website_hr_recruitment`.

[1]: https://github.com/odoo/odoo/commit/f1ee633f26a78636fede3e2b600c801b5f474a50

Task-2781443

closes odoo/odoo#89520

X-original-commit: 5e8be9024b8fd1cdd7caf3cb711861a4a7bee2c8
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-04-24 13:05:08 +02:00
Xavier-Do f50162162c [FIX] crm: used cr date for date_closed
This is mainly here to avoid future randomness on tests and have a
coherent value with previous commits

Part-of: odoo/odoo#85525
2022-04-04 16:48:17 +02:00
Florian Charlier f0e1e60528 [IMP] {*_,,}event{,,_sms}: update sms reminder template
* = website

Change the wording of the sms reminder template to make it sound friendlier and
more complete. The sms will include the event address if it is defined.
Otherwise, it will link to the event page if website is installed.

A one line-formatted version of the venue is added to the model to be used in
the template and other places.

This required to update `event_registration.get_date_range_str` to not include
the time when describing an event happening more than a month from the current
date, which makes sense as there is no reason to specify the time only in that
case, and we add the time somewhere else when it's useful anyway.

For consistency, Wembley Stadium is updated to London timezone in the demo
data.

Task-2777183

closes odoo/odoo#85664

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:24 +02:00
Jérémy Hennecart (jeh) d4780b756d [IMP] website_event: display the timezone when a datetime is used
Cleanup all the places where an hour or a datetime is been used
to display with the date the corresponding timezone.
The goal is to know the timezone used where a datetime is displayed
on the event pages.

task-2458013
COM PR: odoo#78049

Part-of: odoo/odoo#78049
2022-03-23 20:18:34 +01:00