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
closesodoo/odoo#82486
X-original-commit: b3b9627b655cd7cb928925affed6cc8d92661e8d
Related: odoo/enterprise#23364
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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)
closesodoo/odoo#81028
Related: odoo/enterprise#23094
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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)
closesodoo/odoo#81717
Related: odoo/enterprise#23046
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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)
closesodoo/odoo#81604
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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
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
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
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
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
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)
closesodoo/odoo#81098
X-original-commit: 10732e077d4bfc296ca59a9c3df613b9fd1cb275
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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)
closesodoo/odoo#80672
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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
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@210c9daebcclosesodoo/odoo#81025
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
``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
closesodoo/odoo#80947
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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
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
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
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
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
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
closesodoo/odoo#79356
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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
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
In one week, this test failed about 4 times, seems mainly on nightly
enterprise. Let us update counter accordingly.
closesodoo/odoo#80164
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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)
closesodoo/odoo#79895
X-original-commit: 5b3ad80f427fc2ac0e91622a94f0f63b3d2bf721
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
closesodoo/odoo#79466
X-original-commit: 63211eb48d3ac54e22dbee48f3131bd46aea5599
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#77265
Related: odoo/enterprise#21200
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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>
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)
closesodoo/odoo#77845
Related: odoo/enterprise#21456
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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
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
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
closesodoo/odoo#76301
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#77120
X-original-commit: 2387c2ee6272a7c260386427c108208e747b819b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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.
closesodoo/odoo#76292
X-original-commit: 4b853ad321d89075ef6151c64160a6e9db15c2e6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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>
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>
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>
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.
closesodoo/odoo#76040
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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
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
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
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
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
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
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
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