Commit Graph
100 Commits
Author SHA1 Message Date
Thibault Delavallée 37db926fe8 [REF] various: remove usage and dependency on html2text library
We have our own html2plaintext, already used in lot of use cases instead of
just a few for the html2txt library.

Notably for emails: most emails going through Odoo stack use our simple
html2plaintext to format the body alternative. When no body alternative
is given to ``build_email`` an alternative is built using the library to
remove. Using our own parser allows to have the same results compared to
using ``MailMail.send()``. Difference lies in spaces and new lines as well
as markdown. Our html2plaintext is a bit simple and does not try to generate
Markdown but generates a simple plaintext version.

This also helps solving some issues with depending on that library.

Task-2702034

closes odoo/odoo#82486

X-original-commit: b3b9627b655cd7cb928925affed6cc8d92661e8d
Related: odoo/enterprise#23364
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-12 16:43:16 +00:00
Thibault Delavallée be878f5d6a [IMP] base: test body alternative done in build_email
Purpose of this commit is to add some tests about body alternative done
in build_email when none is given. It uses a library we are about to
remove and testing it is therefore necessary.

Task-2702034

X-original-commit: 92b102c87bbdb9073f794a414a41460e4146acd2
Part-of: odoo/odoo#82486
2022-01-12 16:43:16 +00:00
Thibault Delavallée 14bbac3f35 [FIX] base: temporary files were not correctly attached 2021-12-23 12:50:14 +01:00
Thibault Delavallée 25c4f406f7 [IMP] crm: avoid unnecessary partner update on convert
Currently when converting leads we may end up with False being compared to
a void partner recordset. Due to the use of != this leads to unnecessary
update of leads when no partner is involved in lead convert.

By comparing recordsets everytime we save queries and performance each
time a convert on a lead without customer is done. This leads to about
saving 150 queries in heavy duty tests.

Task-2722512 (Lead: performance in convert without customer)
Task-2722513 (Lead: performance master task)

closes odoo/odoo#81028

Related: odoo/enterprise#23094
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-24 14:57:03 +00:00
Thibault Delavallée 16561f042a [ADD] test_crm_full: test module for crm
Purpose of this commit is to add a base module holding tests for the whole
crm ecosystem. It notably holds currently performance tests, allowing to
track future improvements and changes.

Task-2720144 (Crm performance tests)
Also linked to Task-2703285 (Event performance improvements - event_crm)

closes odoo/odoo#81717

Related: odoo/enterprise#23046
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-21 20:20:50 +00:00
Thibault Delavallée b173dae36b [IMP] test_event_full: go post-install
In order to test performances let us be sure all modules are installed.

Task-2703289 (Event testing and coverage)
Preparing Task-2703285 (Event performance improvements)

Part-of: odoo/odoo#81717
2021-12-21 20:20:50 +00:00
Thibault Delavallée 8e867c0c8f [UPD] test_event_full: update counters
Followup of odoo/odoo@034d369 . Now that followers computation is done in
batch we gain 1 query per additional record to create in a recordset. Indeed
some searches are now performed in batch instead of in loop. This allows to
gain notably 19 queries on batch of 20 records to create for example.

Task-2703289 (Event testing and coverage)
Preparing Task-2703285 (Event performance improvements)

Part-of: odoo/odoo#81717
2021-12-21 20:20:50 +00:00
Thibault Delavallée f4ef456cd7 [IMP] test_event_full: add tests without event_crm impact
Current registrations tests run with event_crm rules being activated. In
order to better highlight their impact (which is important) let us have
some tests skipping them.

Followup of odoo/odoo#81068

Task-2703289 (Event testing and coverage)
Preparing Task-2703285 (Event performance improvements)

closes odoo/odoo#81604

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-21 08:07:03 +00:00
Thibault Delavallée 90a9495887 [FIX] test_event_full: fix rare extra query on batch registration creation
Seems soemtimes an extra query is generated.

Part-of: odoo/odoo#81604
2021-12-21 08:07:02 +00:00
Thibault Delavallée 2411a6b69c [IMP] test_event_full: add performance on frontend and registration tour
Purpose of this commit is to add performance tests for some commonly used
URLs related to event: the main event page and browsing a given event.

A complete registration tour involving buying tickets, answering questions
and filling billing information is also added under a query counter check.
This allows to see a bit how many queries are involved in that flow. To
ease reproduction a data is added but not imported, allowing to quickly see
what happens locally instead of having to debug tests.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:49 +00:00
Thibault Delavallée eee03e9ce0 [IMP] test_event_full: add performance tests
Add performance test for event and registration creation. This serves as a base
for future cleaning and improvements for both models and performance in event
models targeting v16.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:49 +00:00
Thibault Delavallée 79c2979c90 [IMP] website_event(_questions): add anchors to ease registration testing
Add some classes and name on some DOM elements easing tests writing. Otherwise
xpath are hard to write, especially in tours where it can quickly become a
PITA to write and update.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:48 +00:00
Thibault Delavallée d55165931a [FIX] website_event: pre-compute website_menu
With this commit we ensure website_menu field is computed before calling
create. Indeed otherwise it is computed after the create if value is not
given and stays to False. This is due to the compute that does not distinguish
a False value from user from a False value added as default. This breaks
the event type -> event synchronization when no form view is used (either
through UI or in code).

With this commit, it is computed before resuming the creation and field
is correctly synchronized with the template value unless the user gives
a value at create time.

Task-2341656 (Event submenus shenanigans)

Part-of: odoo/odoo#81068
2021-12-16 17:33:48 +00:00
Thibault Delavallée ea56328280 [IMP] test_event_full: add tests for template and seats synchronization
Purpose of this commit is to add tests about template (``event.type`` model)
synchronization when creating an event. Some tests already exist in event sub
addons but this one has all community features activate. It eases checking the
final result.

Tests about seats computation and registration creation prevention due to
limits are also added as this behavior may be re-implemented soon.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:48 +00:00
Thibault Delavallée ad5c08ca09 [REF] test_event_full: cleanup tests
Purpose of this commit is to make test_event_full globally independent from
other event sub modules testing data. We now define a complete event type
with all sub options clearly activated in a single setup. That way tests
in test_event_full are easier to read, understand and modify.

A custom report replacing badge report is added as the base one is quite
complex. It is easier to test the result with simpler templates.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:48 +00:00
Thibault Delavallée 237911775c [REF] website_event_*: remove manual datetime patch
Use freezegun as it is more easy to use and allow to remove a lot of extra
boilerplate. Indeed manually patching datetime is a PITA as a lot of imports
have to be patched.

A custom patching has to be done for create_date, as it is done using a value
stored on the cursor (cr._now), based on SQL now. As it has nothing to do
with standard python library it cannot be patched using freezegun.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:47 +00:00
Thibault Delavallée db19463f25 [REF] event(_*): clean tests common files
Purpose is to have a common event class for users and useful stuff (customers,
products, ...) but lessen usage of common test data through sub modules.
Indeed having a "global event type" test data updated in various addons is
actually complicated to maintain.

Sub add-ons are updated to use mainly the ``EventCase`` test class holding
users and side data. Data specific to those modules (event type with some
specific configuration notably) is created and used in tests in the given
module only, and not through generic event_type_complex and event_0 test
data anymore.

With this commit tests are more localized to their add-on and modifying data
in a given add-on has less chances to have unwanted side effect in other event
submodules unit tests.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:47 +00:00
Thibault Delavallée 48e92ac956 [FIX] website_event_questions: fix propagation from template
A wrong field is used to control propagation of questions from event template
to child events. Currently an event template must use automated emails to
propagate its questions, instead of correctly checking the question enabled
field ``use_questions``.

As most templates use automated email this was not seen before.

Task-2703285 (event performance)
Task-2703289 (event testing)

closes odoo/odoo#81098

X-original-commit: 10732e077d4bfc296ca59a9c3df613b9fd1cb275
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-09 07:23:20 +00:00
Thibault Delavallée 76bf909c15 [FIX] website: correctly override _render
Oversight of odoo/odoo@aceb086854

closes odoo/odoo#81079

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-08 16:28:49 +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
Thibault Delavallée 2ac230b25b [FIX] website_event_questions: fix propagation from template
A wrong field is used to control propagation of questions from event template
to child events. Currently an event template must use automated emails to
propagate its questions, instead of correctly checking the question enabled
field use_questions.

As most templates use automated email this was not seen before.

Task-2702872 (Event precompute)

Part-of: odoo/odoo#80672
2021-12-08 15:36:50 +00:00
Thibault Delavallée 03004aa95d [FIX] sale: do not force order responsible
With recent update to computed fields [1] order responsible is now always
changed to the partner responsible, or its commercial entity responsible.

This cause issues, notably with ACLs 'own documents only'. Indeed a salesperson
could update or set a partner on an order that would change the responsible and
lead to ACLs issues. Moreover some functional flows automatically set a partner
(online registrations, ...) that would make the responsible change without a
clear notification or warning.

We prefer to keep a less intrusive behavior, aka setting a responsible when
no one is set.

Task-2703285 (event performance)
Task-2703289 (event testing)

[1] odoo/odoo@210c9daebc

closes odoo/odoo#81025

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 09:35:08 +00:00
Thibault Delavallée bd0d951eef [FIX] website_slides: fix choosing of templates in invite wizard
``channel_id`` field is used to compute ``render_model`` of invite wizard
used to filter templates to choose. It is a fake trigger ensuring the
render model field is computed, and then used in template domain
(see ``mail.composer.mixin`` and ``mail.render.mixin``).

As channel_id field is not available in view the domain computation for
template_id is not updated. No template is therefore available in template
m2o field in invite wizard. This commit fixes that by adding the channel_id
field in the view, meaning render_model is now computed.

Task-2709581

closes odoo/odoo#80947

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-07 11:50:54 +00:00
Thibault Delavallée 836428788d [FIX] sms: do not force a void context
When scheduling a mass sms with a template, do not force a void body in
context as default value. Indeed it takes precedence on computation of body
based on template and may lead to a void value being given to create.

Task-2709581

Part-of: odoo/odoo#80947
2021-12-07 11:50:54 +00:00
Thibault Delavallée e8796e6302 [IMP] sms: add precompute on fields
As body and composition_mode are required, an override of create has been
added to ensure they have a value. Indeed compute are computed after creation
which leads to required not being satisfied.

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

Task-2709581

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

Part-of: odoo/odoo#80947
2021-12-07 11:50:54 +00:00
Thibault Delavallée 4d4c66acc4 [IMP] website_slides: remove unnecessary create override
An override of invite wizard exists to give a value to body and subject.
However as those are computed field (not required) this is not necessary.

Task-2709581

Part-of: odoo/odoo#80947
2021-12-07 11:50:53 +00:00
Thibault Delavallée 072522a3e0 [FIX] mass_mailing: correctly set triggers
Some stored mailing fields should use the real mailing_model_id many2one
field for triggers and not sub-fields of it. As those are not stored this
may lead to unwanted writes.

Followup of odoo/odoo#41877

Spotted during Task-2092853

Part-of: odoo/odoo#70859
2021-11-29 19:01:42 +00:00
Thibault Delavallée ad445aaff1 [FIX] website_event: correctly cleanup when removing event website menu
Currently if event website menu main checkbox is unchecked the related website
menu is removed. Its children are also removed through the cascade attribute on
parent_id field.

However this is done in SQL, meaning some overrides on unlink of website.menu
is not called. This does not properly cascade unlink views linked to website
menus through the specific "website.event.menu" model. This leads to some
views staying alive in DB. This causes issues with web editor when calling
``_views_get`` as he may receive several views linked to a given view_id (key)
while it expects only one.

We fix that behavior by removing the menu and its children explicitly. This
calls various overrides done in website_event.

Task-2616588

X-original-commit: 9722baee83adea9808de1247c300e226cf6fc537
Part-of: odoo/odoo#80391
2021-11-25 13:28:51 +00:00
Thibault Delavallée d5b688956b [IMP] survey: display a list-kanban when being ungrouped
PURPOSE

When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.

SPECIFICATIONS

Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.

When grouped, display should be the old one, aka a standard card.

This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.

A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.

An override in website_slides_survey is added to add number of courses using
the survey.

Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.

Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Thibault Delavallée f13857bf74 [IMP] survey: update views naming
As we are about to refactor survey views, especially kanban, let us rename
some views xml IDs. Especially they have few overrides so quick to do.

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Thibault Delavallée 937e5e181a [IMP] mail: allow to display responsible name in avatar widget
Currently mail override of avatar user widget strips user name in
kanban view. Real reason is quite obscure, see odoo/odoo@59641325c7

In this commit we add an option to display both the avatar and the name.
Sometimes you want to display an avatar and a name to have a nice display
especially when focus is more on the displayed user / partner than on
chat capabilities.

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Thibault Delavallée 7c95dd9506 [IMP] sales_team, crm: add chatter on team member view to display trackings
Currently no chatter is added on team member form views. Indeed this model is
mainly technical and accessed through a dedicated menu in configuration.

However some fields are tracked and being able to see tracking information is
important in day to day dealing of team members. This is why we add chatter
on team members form view.

We also add context key to avoid autofollow when creating team members. As
chatter is mainly present for tracking and information no need to add extra
followers automatically. This causes unnecessary notifications.

Task-2679897

closes odoo/odoo#79356

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 10:18:24 +00:00
Thibault Delavallée 1341d52540 [IMP] mail, crm: allow to give a body to tracking
PURPOSE

Concatenate feedback message and tracking when marking a lead as lost. This
currently generates 2 consecutive message about the same change, having a
single one is better from an UI point of view.

SPECIFICATIONS

Allow to link a body to a value change tracking. Tracking is currently done
by accumulating changes in a structure (see ``env.cr.precommit.data`` usage
with ``mail.tracking.<name>`` key). In the end those values are used to
generate a message with tracking value and a subtype.

In this commit we allow to manually set a body used as a message for the
tracking message, adding a new ``mail.tracking.message.<name>`` key. It is
used when posting or logging the tracking message, simply propagated as body
to ``message_post`` or ``message_log``.

In crm we use this when losting a lead through the dedicated wizard. A bit
of custom html allows to have a nice display.

Task-2671709

Part-of: odoo/odoo#78648
2021-11-23 09:39:52 +00:00
Thibault Delavallée 869ada08a0 [IMP] mail: rename tracking methods and clean dead code
Purpose is to have tracking methods beginning with ``_track``, indicating
those are tool methods used for tracking. It helps organizing the mail thread
file and having short but precise method names.

We also remove the usage of ``mail_track_log_only`` context key that is not
used anymore in the code. It allows to shorten a bit the code and make it
easier to read.

Task-2671709

Part-of: odoo/odoo#78648
2021-11-23 09:39:52 +00:00
Thibault Delavallée d1edc9e6a7 [REF] crm: correctly name lost_reason field on lead
As this is a many2one, it should end with an ``_id`` suffix. Otherwise we
may think this is a char field, which was probably the case at one point.

Task-2671709

Part-of: odoo/odoo#78648
2021-11-23 09:39:51 +00:00
Thibault Delavallée a830ceaaf9 [IMP] crm: allow to log a feedback when marking a lead as lost
PURPOSE

Allow sales reps to add a closing note to their lead while it is being marked
as lost. This is currently already done by a lot of sales reps but manually
with the "Log a Note" button.

SPECIFICATIONS

In ``Lost Reason`` model: add a new html field allowing to log a note on the
lost leads. Below the m2o, add an Extra Comment field where users can add a
"closing note". When the wizard is submitted, log this message as a note on
selected records.

Add tests, allowing to test both the wizard and this new feature.

Task-2671709

Part-of: odoo/odoo#78648
2021-11-23 09:39:51 +00:00
Thibault Delavallée d348c5e880 [IMP] crm, test_mail: flush tracking in tests involving tracking
Tracking is generated using commit hooks, meaning they are really sent when
the commit ends. This is done to ease values aggregation and accumulation
through various record updates. In some tests we therefore have to manually
flush the tracking, otherwise it is not created and posted. Notably tests about
lead lost wizard were not flushing and therefore not generated the tracking
messages. Those tests will be improved in future commits, cleaning them is
therefore a necessary step.

We also specifically add some tracking flush in mail performance tests. This
is to be sure we measure impact of a write and tracking separately from
previous transactions. Seems everything is working as intended as warmup and
query counters already perform flushes. Here we simply flush at the end
of the setup to be sure all base is clean before starting tests.

Task-2671709

Part-of: odoo/odoo#78648
2021-11-23 09:39:50 +00:00
Thibault Delavallée cd0c0d631b [FIX] crm: fix query counter in assign performance
In one week, this test failed about 4 times, seems mainly on nightly
enterprise. Let us update counter accordingly.

closes odoo/odoo#80164

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-22 11:56:50 +00:00
Thibault Delavallée 5a315a4364 [FIX] crm: ensure computation of PLS uses deterministic recordsets
closes odoo/odoo#79573

X-original-commit: 406270973250d05f1b9c63694b17391390f19c55
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-17 16:36:40 +00:00
Thibault Delavallée 6349319b0a [FIX] crm: fix randomness in assign tests
Seed is now fixed at beginning of each test to ensure random state is set
once for all and avoid random issues.

Task-2643740

X-original-commit: 85ebcaeaf909cd46743c20bf052360a65e60ea82
Part-of: odoo/odoo#79573
2021-11-17 16:36:39 +00:00
Thibault Delavallée 0afbba8b5b [FIX] calendar: fix recipient of "event update" template
This template runs on calendar event records. It can therefore not really
use 'email' as field to compute a To. Let us void this field as it is used
mainly for a backend action that sets recipients.

Task-2657930 (Email templates fixup)

closes odoo/odoo#79895

X-original-commit: 5b3ad80f427fc2ac0e91622a94f0f63b3d2bf721
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-17 08:26:25 +00:00
Thibault Delavallée 2e5c7fda07 [FIX] website_crm_partner_assign: fix template using unknown variable
Jinja was tolerant to missing variables, QWeb not at all. Let us fix templates
that use outdated or invalid variables.

Task-2657930 (Email templates fixup)

X-original-commit: 1c179d58bf2d4e4c3c9b05d08475966d75754cc6
Part-of: odoo/odoo#79895
2021-11-17 08:26:24 +00:00
Thibault Delavallée 49085a1228 [FIX] digest: improve tone down
Currently digest sending is toned down when being sent if subscribed users
did not connect since more than 3 days. It allows to avoid spamming people
not being active or present anymore.

This is currently limited to daily digests that are set to weekly. However
it may continues to send digests each week until the digest is de-activated.

In this commit we tone down the digest from daily to quarterly depending
on users activity. It is still based on overall activity and not individual
users to avoid complex computation on heavy digests. This will be done in
further cleaning of digests.

Task-2688856 (Digest tone down improvement)

X-original-commit: f916354baec5bb69511069a829ab1648a5ebaccd
Part-of: odoo/odoo#79877
2021-11-16 16:58:39 +00:00
Thibault Delavallée d27a6f7276 [FIX] digest, mass_mailing: correctly set body before odoo mentions
Body is used in statistics as an additional content to digest layout. However
it is strangely located after Odoo mentions (Send by, ...). Currently link
trackers statistics are therefore at the end of the email. They belong to
the "core" section of the emails.

Task-2686586 (Repair mailing statistics email)

X-original-commit: c9a503eec9a40809b6a88d56f84c06a66ad6dbeb
Part-of: odoo/odoo#79877
2021-11-16 16:58:39 +00:00
Thibault Delavallée db5315efad [FIX] digest, mass_mailing: fix crash about impossible 'unsubscribe'
Mailing statistics emails are build on digest layout. This layout contains a
reference to the digest unsubscribe mechanism, which obviously does not work
with mailing statistics emails as they currently have no opt-out mechanism.
This commit fixes that part of the template so that unsubscribe is displayed
only with digests.

Task-2582128 (Digest onboarding and usage improvement)
Task-2686586 (Repair mailing statistics email)

X-original-commit: febe4506cf14ba9308d85538515eb61c4638b18d
Part-of: odoo/odoo#79877
2021-11-16 16:58:38 +00:00
Thibault Delavallée 4ea673bfd8 [IMP] digest: add tests about tone down and unsubscribe
Purpose is to ensure behavior of digests and prepare future fixes and
improvements. Tone down and unsubscribe links are currently not tested.
This commit fixes that by adding relevant tests.

Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onbarding and usage improvement)

X-original-commit: f340859a3508ebb369b7116f64c81d8f03774e61
Part-of: odoo/odoo#79877
2021-11-16 16:58:37 +00:00
Thibault Delavallée 9c25a65fa2 [FW][FIX] digest: use email queue to send digest emails (and improve tests)
When there is an issue updating digest state (concurrent access, or some other
error that may happen), digest emails may be sent in loop. Indeed they are
currently sent in the same transaction that the one that updates digest state.
This means that emails may be sent even if digest update fails.

As we do not think timing is so important, we now use the email queue to send
digest emails. That way email creation is rollbacked and they are not sent
if digest update fails for some reason.

Tests are updated to take into account we now create outgoing mail.mail. Some
tests are also added about mail values and subscription, and cleaned in a more
general way.

Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onbarding and usage improvement)

X-original-commit: 96a14816cb48d9324482eec3de0ed3fccc0d7ecf
Part-of: odoo/odoo#79877
2021-11-16 16:58:37 +00:00
Thibault Delavallée 54780667a9 [FIX] digest: add missing depends on is_subscribed field
Currently subscribed field is not computed again if user_ids field value
changes on a digest. This has probably few consequences in current code
but better be sure this field is correctly updated in a given transaction.

Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onboarding and usage improvement)

X-original-commit: 3a7c1348750d0977a663e50be05bad9f2679f8ff
Part-of: odoo/odoo#79877
2021-11-16 16:58:37 +00:00
Thibault Delavallée 73672cfc9f [FIX] mass_mailing: fix mail related values of statistics emails
When mailings have no responsible, KPIs emails are broken as there is no
from and to on the mail. This leads to mails being invalid and set in
exception.

Moreover currently author and from / to of those D+1 emails are not coherent
as author is current user (generally odoobot as this is generated through
a cron) while from and to are based on mailing responsible.

In this commit we make statistics emails more coherent
  * when a responsible is set on the mailing: author, from and to are linked
    to the responsible;
  * when there is no responsible, current user is set as it may be sent by
    regular people;
  * reply-to is set to company email as it is often the case with 'marketing'
    emails;

Task-2686586 (Repair mailing statistics email)

X-original-commit: 95a21ca16f560cf4341c547f6bc909d3261acd1b
Part-of: odoo/odoo#79877
2021-11-16 16:58:36 +00:00
Thibault Delavallée 8df08eac57 [FIX] mass_mailing: use queue to send statistics emails
When there is an issue updating mailing state (concurrent access, or some other
error that may happen), mailing statistics emails may be sent in loop. As we
do not think timing is so important, we now use the email queue to send
statistics emails.

Task-2686586 (Repair mailing statistics)

X-original-commit: f78ac45c2eafc3cf6b213e1f1608e76e243bd8d2
Part-of: odoo/odoo#79877
2021-11-16 16:58:36 +00:00
Thibault Delavallée c59039b195 [FIX] mass_mailing: avoid clicks overriding reply trace state
Currently if someone replies to a mass mailing email, then performs a click on
tracked links, final trace status is set to opened. Indeed both reply and
click set the trace as opened, as replying or clicking imply opening the
mail.

Update is the following
  * user replies -> set status to open, then set status to reply, and update
    open_datetime and reply_datetime;
  * user clicks -> set status to open, then update click_datetime;

In the end the trace is left as opened while it is replied, with a click
datetime attached to the trace. To avoid unnecessary status update, a trace
is set to opened only if it is not already opened or replied. Other statuses
should not override themselves.

Task-2692316

X-original-commit: ce88d364369c8b58256e8d93b7cb506a2c262a34
Part-of: odoo/odoo#79877
2021-11-16 16:58:35 +00:00
Thibault Delavallée 581286346a [FIX] mass_mailing(_sms/_crm/_sale): fix digest layout change breaking mailing statistics
Recently some "de-t-rawify" [1] was done through Odoo. A change in digest
layout broke mailing statistics. Indeed mailing statistics are build on digest
main layout to re-use it. In mailing case a ``kpi_name`` value was missing when
rendering statistics columns, leading to a crash. This is now fixed in both
mailing and sms marketing.

In this commit we also add tests for statistics emails (D+1 KPIs) rendering
for both mail and SMS marketing mailings. Email details are also tested
in order to better highlight future changes and tweaks in email sending
linked to D+1 KPIs emails.

Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onboarding and usage improvement)
Task-2686586 (Repair mailing statistics email)

[1] odoo/odoo@c56e8c9f5a

X-original-commit: c9905ceb3172d8e80e3aff4ae9bc925dcb6b6519
Part-of: odoo/odoo#79877
2021-11-16 16:58:35 +00:00
Thibault Delavallée dad888de50 [REF] test_mail_full: cleanup test data, use default one
Purpose of this commit is to have as less custom test data as possible. In
some sms tests we can re-use existing mailing, leading to more standard
tests and expected results.

We also improve ``gateway_sms_sent_click`` tool that now creates random IP
addresses allowing to have various clicks on a given tracker. Indeed as IP
is unique several clicks are currently set into the same click record, which
will now not be the case anymore.

Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onbarding and usage improvement)
Task-2686586 (Repair mailing statistics email)

X-original-commit: f76b154412a111067203979075fa65f198cc39f4
Part-of: odoo/odoo#79877
2021-11-16 16:58:35 +00:00
Thibault Delavallée 35ccabf051 [IMP] digest: add private methods to manage digest members
Purpose is to ease digest management and testing. Public methods still work
as before this commit, simply calling the private implementation. New private
methods allows to better manipulate subscribed users. Those will be used
notably as shortcuts in tests.

Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onbarding and usage improvement)

X-original-commit: 3045c49f0e10bd50757fcbaa75f9aaad49a966ce
Part-of: odoo/odoo#79877
2021-11-16 16:58:34 +00:00
Thibault Delavallée 07c872d674 [IMP] gamification: remove m2m display
PURPOSE

Gamification display is slow when being heavily used. Indeed the m2m towards
users is used in kanban and form views, leading to a huge data fetch when
being used in production environment with lots of users.

SPECIFICATIONS

Remove user_ids m2m from views. Indeed in some heavily used DBs you may have
more than 10K records in user_ids, leading to a huge m2m tags to display.

Replace it by an optimized count, used in

  * form view: as a stat button redirecting to participants of a challenge;
  * kanban view: a line (replacing the 11 first avatars) redirecting to
    participants of a challenge;

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:50 +00:00
Thibault Delavallée 3fe3c7a234 [MOV] gamification: reorder and rename data files
Purpose of this commit is to rename and reorder data by main model. It
allows to better understand module organization and find data one may have
to update.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:50 +00:00
Thibault Delavallée 0a03960e8b [MOV] gamification: reorder and rename model files
Purpose of this commit is to rename and reorder models by main model. It
allows to better understand module organization and find models one may have
to update.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:50 +00:00
Thibault Delavallée 4d7efe41f5 [MOV] gamification: move menus definition
Purpose of this commit is to have all gamification menus defined in a single
file. It helps reorganizing a module TOC (menus) when doing some b2b like
on an app. Otherwise menus are split across several files and finding them
and keeping them organized is not easy.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:49 +00:00
Thibault Delavallée 2ae9d590e1 [MOV] gamification: reorder and rename view files
Purpose of this commit is to rename and reorder views by main model. It
allows to better understand module organization and find views one may have
to update.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:49 +00:00
Thibault Delavallée 6908c475c5 [FIX] mail, survey, website_slides: fix logger usage
Make CI/Style happy even if not really related to this PR.

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
2021-11-10 09:58:10 +00:00
Thibault Delavallée 4059bbabac [IMP] mail: give access link to document in "light" notification layout
Light template is used is several notification processes as an alternate
layout to the classic one. It currently lacks any link to the document that
generated the notifications.

We add this behavior in this commit. Behavior is the same as the classic
notification email, aka a link to mail/view that chooses what to do based
on access rights and user status (internal, portal, ...).

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée f9dbd38720 [IMP] mail, various: rename custom_layout / notif_layout context usage
RATIONALE

Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.

SPECIFICATIONS

On template model: rename ``notif_layout`` parameter of ``send_mail`` to
``email_layout_xmlid`` to be coherent with naming used in other parts of the
code. Moreover it better indicates we expect an xml id.

On rating model: rename ``notif_layout`` parameter of ``rating_send_request``
to ``email_layout_xmlid``, for the same reasons as above.

In various wizards: support ``email_layout_xmlid`` context key when no field
is available, notably because this is still done manually in some wizards
like survey invite. Keep a fallback on ``notif_layout`` but remove support of
``custom_layout`` deprecated since quite a long time.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée 3659546738 [IMP] mail, various: support email notification xmlid at model level in composer
RATIONALE

Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.

SPECIFICATIONS

Get rid of context usage (``custom_layout``) and use a real field on composer
model: ``email_layout_xmlid``. Use now a default value coming from context
(default_email_layout_xmlid) instead of custom_layout.

Support old context key in composer for backward compatibility, working like
a default value for the field itself.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
UPG odoo/upgrade#2829

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée 88d66434a8 [REM] mail: remove unused notification template
RIP ``mail_notification_borders``. You were a joyful comrade.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Related to odoo/upgrade#2829

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée a480f1f3cd [MOV] mail: split templates to better isolate notification layouts
Just separating notification layouts from templates used for various discuss
or chatter related notifications. Purpose is to have shorter but cleaner
files.

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
2021-11-10 09:58:08 +00:00
Thibault Delavallée b109d12671 [FIX] test_website_slides_full: activate variants to avoid deinstallation
We want to activate product variant by default for testing product configurator.
Otherwise Odoo want to de-install the whole module due to dependency chain.

Task-2677144

closes odoo/odoo#79466

X-original-commit: 63211eb48d3ac54e22dbee48f3131bd46aea5599
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-08 10:16:04 +00:00
Thibault Delavallée f99e8c03e2 [IMP] test_mail_full: add a test model for both SMS / phone and activities
Purpose is to ease future new tests about activities management involving
phone numbers and SMS sending. Let us have a new test model with both
mail.thread.phone and mail.activity.mixin mixins. It will be used first
in enterprise to test impact of voip and documents features added in activity
models.

Task-2657021

closes odoo/odoo#77265

Related: odoo/enterprise#21200
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-29 07:44:41 +00:00
Thibault FrançoisandThibault François d3f35714f6 [IMP] crm: add tests for current MC behavior
Purpose of this commit is to highlight current behavior of multi company
in lead. Notably a company is set at creation even when no team or user
is set, leading to a lot of issues when dealing with lead merge or convert.

Task-2520276

X-original-commit: dc8d82bbe032cef2f732fdfb1ded3068edc37371
Part-of: odoo/odoo#78860
Co-authored-by: Thibault Delavallée <tde@odoo.com>
Co-authored-by: Thibault François <tfr@odoo.com>
2021-10-27 06:39:50 +00:00
Thibault Delavallée 9146b68b3f [IMP] test_mail: add test for reply_to computation on records
Purpose is to assert current behavior as this may change in master. Two
kind of tests are added: performance and multi company.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

closes odoo/odoo#77845

Related: odoo/enterprise#21456
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 16:53:46 +00:00
Thibault Delavallée 201d6bf771 [FIX][IMP] test_mail: be sure performance test include mail gateway
Purpose of query counter tests is to try to match real life use cases. In
mail those generally involve a correctly configured mail gateway. This is
why we set those parameters in performance tests, leading to a small increase
in some counters.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:46 +00:00
Thibault Delavallée f3a24527d2 [IMP] test_mail(_*): improve performance data preparation
Cleanup a bit ``BaseMailPerformance`` class: have more data available done
in setUpClass, then remove unnecessary code in sub classes. Overall purpose
is to lessen boilerplate in sub modules.

Task-2657021 (Performance tests cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:46 +00:00
Thibault Delavallée c0d16beb7e [FIX] various: update query counters to last runbot state
A lot of counters are not up to date. Seems some optimizations were done
allowing to lessen query counters.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:45 +00:00
Thibault Delavallée 974f073b11 [FIX] test_mail: improve multicompany activation
Let us use existing data for multi-company tests created when calling a specific
method available in mail tools. We may then remove TestMailMultiCompanyCommon
that is used in a single test, with an hardcoded currency_id (hem).

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:45 +00:00
Thibault Delavallée abd48cfb03 [IMP] mail: reorganize code added for discorduss
Just putting code where it belongs, in sections about access rights / discord
API. After a lot of updated some cleaning is always welcomes. This prepares
future code renaming and improvements.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:45 +00:00
Thibault Delavallée d6434fe846 [IMP] base: improve ir.mail_server form view readability
PURPOSE

Help people setuping their mail server with clear labels and form view.

SPECIFICATIONS

Rename Description to Name, as Description indicates a secondary text
field. Add a placeholder to indicate it is used as a functional name
and not a technical field.

Relabel the field for filtering to FROM Filtering. Current From Filter
could lead to think it filters incoming emails which is not the case.

Move button for testing in header as on all form views.

Use radio buttons for authentication and encryption to display available
settings directly to user. This is more user friendly than selection boxes.

Split connection information in two groups: authentication and security.
Each group comes with its options below main radio-based field.

Task-2628092

closes odoo/odoo#76301

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 15:40:36 +00:00
Thibault Delavallée c68f655782 [FIX] test_mail: fix activity tests
Fix some activity tests: use real test models, try to avoid date issues
by using freezegun.

Followup of odoo/odoo@a26e6e954c and odoo/odoo@06dee038dd .

Task-2654840

closes odoo/odoo#77120

X-original-commit: 2387c2ee6272a7c260386427c108208e747b819b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-24 11:09:17 +00:00
Thibault Delavallée a877cb171c [FIX] mail: be sure layout renders on every chatter models
Task-2621326
PR odoo/odoo#76441

closes odoo/odoo#76459

X-original-commit: 242392b81b2b2ab342c38850ea9ccb8599a2f421
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-14 07:11:03 +00:00
Thibault Delavallée 2973ecd720 [IMP] test_mail: improve notification and post tests
Add tests for notification layouts. Purpose of this commit is to test rendering
of all current email notification layouts, ensuring they effectively render
well whatever changes done in mail thread mixin code about template preparation
or rendering. They should also correctly render on simple chatter models which
is currently not the case.

A test ensuring message_post returns an ID when called by RPC should be
called post install. That way we test overrides that frequently break
this method API, and not only the base one.

Task-2621326
PR odoo/odoo#76441

X-original-commit: d7343dc8917505914058b698c59e6520dbacffd5
Part-of: odoo/odoo#76459
2021-09-14 07:11:02 +00:00
Thibault Delavallée bc7dbfea63 [IMP] test_mail: improve tests for template translations
Extract translations and preparation to setup of TestTemplate class. That
way those are usable in other tests.

Create a new model to test language computation. It holds both a string
and a partner field, allowing to test a bit jinja-based language computation.

Task-2643750

X-original-commit: 7896cbc4f2256122b5cf6c5506921398f2ebc931
Part-of: odoo/odoo#76458
2021-09-14 07:10:57 +00:00
Thibault Delavallée 262e45440b [REV] Revert "[FIX][IMP] web: fix ribbon CSS to allow its use on kanban"
This reverts commit odoo/odoo@3d72a6a4d2 . This code is not used
as finally Kanban ribbon as a widget has not been added after review. Moreover
current use of ribbon classes in kanban is broken.

closes odoo/odoo#76292

X-original-commit: 4b853ad321d89075ef6151c64160a6e9db15c2e6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-09 20:19:16 +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
Thibault DelavalléeandVictor Feyens d875bcd79d [IMP] gamification, google_drive, project: limit usage of search on ir.model
Purpose of this commit is to globally improve code performance by limiting
search impact by using cache when accessing ir.model.

Note that tests are left untouched as they are generally done using admin
(or at least data preparation is done as admin). Diff is kept small currently.

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
Thibault Delavallée 2625d92b8b [IMP] mail, note: correctly name thread compute methods
Just cleaning those method names and removing unnecessary definition override
in note.

Task-2638444
PR odoo/odoo#76005
2021-09-08 07:56:03 +00:00
Thibault DelavalléeandVictor Feyens e87b46864c [IMP] mail(_*): improve compute in batch and remove unnecessary defaults
Purpose of this commit is to clean field definitions by

  * doing compute in batch: especially when the loop can be reduced to a single
    computation / batch assignment (based on groups or config parameter for
    example);
  * remove default when having a compute as computes should completely define
    the field value at any time;

Some side dish code cleaning is performed at the same time: unnecessary
import or dead code removal.

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:02 +00:00
Thibault Delavallée 8e0632d69a [IMP] mail: add test for portal group log
Purpose is to add some tests for newly added feature logging portal access
granting. Some code is also cleaned to avoid unnecessary computation when
groups are not modified on user model.

closes odoo/odoo#76040

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-06 16:53:00 +00:00
Thibault Delavallée 2915a939a8 [IMP] test_mail_full: add some tests, notably for SMS deletion
closes odoo/odoo#75895

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-03 09:26:12 +00:00
Thibault Delavallée d98906c411 [REF] test_mail_full: remove unnecessary mock of link tracker
Another one already exists. Let us clean some code.

Part-of: odoo/odoo#75895
2021-09-03 09:26:11 +00:00
Thibault Delavallée bd1eeababa [FIX] auth_totp: fix file name for mail template
Zairisse too much esse.

Part-of: odoo/odoo#75895
2021-09-03 09:26:11 +00:00
Thibault Delavallée 1b3fca70f7 [IMP] sms: allow to keep sent sms
When calling send on SMS, sent SMS are unlinked. If a ``delete_all`` parameter
is true, failed SMS are also unlinked.

In this commit we allow to control that behavior with two boolean, one for
sent SMS and one for failed SMS. This allows to ask to keep sent SMS and
update their status accordingly.

More control is necessary notably to enable IAP feedback on sent SMS as
an error could happen after considering it as sent. Some flows will have to
be updated to decide whether this status is necessary and if SMS are kept.
This commit prepares ground for that feature by already improving methods
and API.

Task-2634957
Prepares Task-2535005 (SMS view pimp) and Task-2560666 (IAP feedback)
PR odoo/odoo#75798
2021-09-02 01:55:27 +00:00
Thibault Delavallée e86268222b [FIX] sms: fix mock when sending sms
Only SMS not in error should be considered as sent instead of being
unlinked. This has no effect on current tests but will be used in
future cleaning.

Task-2634957
Prepares Task-2535005 (SMS view pimp) and Task-2560666 (IAP feedback)
PR odoo/odoo#75798
2021-09-02 01:55:27 +00:00
Thibault Delavallée feb510ae93 [IMP] sms: improve synchronization of SMS actions with notifications
Improve cancel / set outgoing actions on sms model. This notably allows to
synchronize notifications when hitting action buttons on sms form view.

Also add an action to set as error. This will be used when having IAP
feedback on SMS sending.

Task-2634957
Prepares Task-2535005 (SMS view pimp) and Task-2560666 (IAP feedback)
PR odoo/odoo#75798
2021-09-02 01:55:27 +00:00
Thibault Delavallée 18b555bbf8 [IMP] survey: reorganize (and fix) demo data
Purpose is to clearly separate various available demo surveys, their user
inputs and input lines. It is easier to update and maintain those demo
data in several files than hidden in big files or CSV files. No change
should occur with this commit as this is only some data manipulation.

We also quickly cleanup some demo data in this commit. Notably

  * remove unnecessary user inputs;
  * improve passed / succeeded statistics by improving or adding right
    answers;
  * fix some typos;

Task-2634805
PR odoo/odoo#72298
2021-08-31 23:34:54 +00:00
Thibault Delavallée 1644c3d8d1 [FIX] crm_iap_mine: stop refining builtins
Help is a keyword. We may use something else.

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
2021-08-25 13:10:52 +00:00
Thibault Delavallée 5f24dccd40 [FIX] website_crm_iap_reveal: fix potential loops if iap result is broken
Currently if output from IAP does not hold 'no_result' for each failed
IP address we may end up with a loop. This commit ensures that a void
result for an ip correctly set its views as no_result to avoid endless
loops.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
2021-08-25 13:10:44 +00:00
Thibault Delavallée f66d487253 [IMP] website_crm_iap_reveal: add tests for reveal
Purpose of this commit is to add some tests related to lead generation through
reveal and website. We add tests checking IAP response management and lead
creation. We introduce a mock for IAP reveal calls, as well as some tool data
generation methods in base IAP mock class available in iap_crm.

We also add some tests for corner cases (credit issue, no result, exception
during call) in order to improve coverage.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
ENT PR odoo/enterprise#20424
UPG PR odoo/upgrade#2770
2021-08-25 13:09:58 +00:00
Thibault Delavallée 5f07a52a30 [IMP] iap, crm_iap_mine: add tests for mine
Purpose of this commit is to add some tests related to mine request. We add
tests checking IAP response management and lead creation. We introduce a
mock for IAP mine calls, as well as some tool data generation methods in
base IAP mock class available in iap_crm.

We also add some tests for corner cases (credit issue, no result, exception
during call) in order to improve coverage.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
ENT PR odoo/enterprise#20424
UPG PR odoo/upgrade#2770
2021-08-25 13:10:31 +00:00
Thibault Delavallée df824e0a33 [MOV] website_crm: reorganize and guidelinize addon
PURPOSE

Perform a global renaming / cleaning of IAP features often added or merged
with minimal review. Time to cleanup !

SPECIFICATIONS

Reorganize module according to guidelines. Notably correctly name files,
split python fiels and views according to their model, split some data
to ease module organization and understanding.

Perform some code re-ordering in some big files in order to have code clearly
separated by main usage and ease future changes.

Quickly lint or update some view names.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
ENT PR odoo/enterprise#20424
UPG PR odoo/upgrade#2770
2021-08-25 13:10:27 +00:00
Thibault Delavallée fd86521e12 [MOV] website_crm_iap_reveal: reorganize and guidelinize addon
PURPOSE

Perform a global renaming / cleaning of IAP features often added or merged
with minimal review. Time to cleanup !

SPECIFICATIONS

Reorganize module according to guidelines. Notably correctly name files,
split python fiels and views according to their model, split some data
to ease module organization and understanding.

Perform some code re-ordering in some big files in order to have code clearly
separated by main usage and ease future changes.

Quickly lint or update some view names.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
ENT PR odoo/enterprise#20424
UPG PR odoo/upgrade#2770
2021-08-25 13:10:23 +00:00
Thibault Delavallée 7951870b3e [MOV] crm_iap_mine: reorganize and guidelinize addon
PURPOSE

Perform a global renaming / cleaning of IAP features often added or merged
with minimal review. Time to cleanup !

SPECIFICATIONS

Reorganize module according to guidelines. Notably correctly name files,
split python fiels and views according to their model, split some data
to ease module organization and understanding.

Perform some code re-ordering in some big files in order to have code clearly
separated by main usage and ease future changes.

Quickly lint or update some view or record names.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
ENT PR odoo/enterprise#20424
UPG PR odoo/upgrade#2770
2021-08-25 13:10:19 +00:00
Thibault Delavallée 528880aa9c [MOV] website_crm_iap_reveal: rename `crm_iap_lead_website` module
PURPOSE

Perform a global renaming / cleaning of IAP features often added or merged
with minimal review. Time to cleanup !

SPECIFICATIONS

Rename ``crm_iap_lead_website`` to ``website_crm_iap_reveal``. This module
is an addition to ``website_crm``, notably using visitor based information
to generate leads based on rules.

LINKS

Task-2630969
Prepares Task-2600047 (code improvements and cleaning)
COM PR odoo/odoo#75514
ENT PR odoo/enterprise#20424
UPG PR odoo/upgrade#2770
2021-08-25 13:10:15 +00:00