Previously a blacklisted phone number or email address could only be
removed from their respective blacklist by going to the corresponding
blacklist view [in mass_mailing_(sms)] and manually
archiving/deactiviting the entry. All users could see that an email was
blacklisted via an fa-ban icon added next to their corresponding field
in the modules: crm, mass_mailing, mass_mailing_sms, and contacts (via
extension).
This commit adds additional fa-ban icons next to blacklisted phone
numbers and makes all instances of these icons clickable to remove them
from their corresponding blacklist using a wizard. There are several
limitations to this implementation including:
1. If both a mobile and phone number field appear within a crm lead
instance, then only the mobile field will indicate if it is blacklisted
(due to current implementation of PhoneMixin which only checks 1 phone
value against the blacklist and "sms" which returns mobile numbers first).
I.e. if a phone field value is blacklisted, but a value is typed into the
mobile field, then the phone field will never indicate that it is blacklisted.
2. If someone clicks on a unblacklisting icon after changing the
corresponding field value without clicking off the field input, then the
latest typed in value will be the one submitted for unblacklisting,
which may not actually be blacklisted (due to "is_blacklisted" flag
being a computed field and it not having a chance to re-compute to hide
the button).
3. If someone changes values in the blacklist, then someone who already
has a form open will not see icon disappear until something triggers a
re-compute of the "phone_sanitized_blacklisted" flag (this was already the
case with the icon, but now a user may try to unblacklist a value that is
already unblacklisted.)
4. Since the icon needs to be visible by everyone to indicate whether or
not a phone/email is blacklisted, users without corresponding unblacklist
permissions will be able to click on the icon. When they click on it, they
will be informed they do not have permission to unblacklist. A wizard was
determined to be the best way to implement this unblacklisting for the
following reasons:
- A "Unblacklisting Reason" is needed and will not be stored as a field.
- A field widget is unable to do this due to security settings +
inability to refresh view after unblacklisting with a
"Unblacklisting Reason" without wiping unsaved changes.
Additionally, to better align with GDPR, the corresponding form view for
the phone/email blacklist has been updated to use the same wizard to
track "Reason for unblacklisting". Unfortunately there is no
straightforward way to prevent direct "Archive" action, so users are
still able to bypass unblacklisting without being asked for a "reason
for unblacklisting".
Supports task: 2117635
Upgrade PR: odoo/upgrade#939
COM PR: odoo/odoo#45315
Minor UX tweaks for more consistent and correct wording, visualization,
and editing ability for mass_mailing and mass_mailing_sms. Specifically:
- Fix all "This email is blacklisted for mass mailing" => ".. mass
mailings" typos
- Make phone blacklist not editable (to align w/ email blacklist)
- Add "Archived" ribbon to phone and email blacklist
- Update menu items and actions
- "Phone Blacklist" => "Blacklisted Phone Numbers"
- "Blacklist" => "BLacklisted Email Addresses"
Supports task: 2117635
Some elements contain superfluous `aria-label` attributes, which
overrides any default useful information. For instance, some dropdown
menus contain the `aria-label` "Dropdown menu" (e.g. the company
switcher), which doesn't add any useful information, as dropdown menus
are already labelled correctly using `aria-expanded`.
This change applies on the following buttons:
- Schedule an activity
- View attachments
- View followers
- Switch company
- Open user options from systray
- The widget `state_selection`
closesodoo/odoo#48317
X-original-commit: e3c7f66e89d7be39dfa4cc3d6b038c6f4a114aa5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
PURPOSE
Move links shortening tools on mail.render.mixin to have rendering and
post procesing tools available on that mixin.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
PURPOSE
Merge rendering tools used in mail and sms templates as well as partially
in mailings and move them directly in mail.render.mixin.
SPECIFICATIONS
Move tools related to language computation from mail.template model to the
mail.render.mixin. It allows to update both
* mail.template: simply update calls accordingly;
* sms.template: remove code doing what is now available through mail.render
.mixin inherit;
Lang field is moved to mail.render.mixin as it is used notably for the language
computation. It therefore adds the field on mailing.mailing model although
not used currently.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
We also have to update code calling directly the rendering itself. Indeed
some code bits does some rendering directly on jinja-enabled input and not
through templates. Those calls have to be updated accordingly.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
PURPOSE
Clean and rename code about language management and template rendering in mail
template model.
SPECIFICATIONS
Clean method naming and try to make code easier to understand and call. Also
add and/or clean docstrings of rendering methods.
Notably
* ``_classify_per_lang``: for each lang-contextualized template, give the list
of record ids;
* ``_render_template``: now working only on a valid list of IDs instead of
allowing both int / list and having a return type depending on the input
type. It allows to simplify code and delegate some processing to callers;
Introduce new API method
* ``_render_lang``: for each record id return the lang matching it;
* ``_render_field``: render a field of mail.template, on given set of record
ids. Usage: template._render_field('body_html', records.ids). Language
computation is available for this method;
Remove the "multi mode" support of rendering that either returned a rendered
value, either a dict based on given ids. Now all methods always work in batch
and caller have to fetch the correct result if necessary.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
PURPOSE
Clarify mail.template, mail.render.mixin and sms.template code organization.
SPECIFICATIONS
Reorganize fields according to their main use.
Remove an unnecessary onchange in mail template model. As "model" field on mail
template is a computed field its computation is sufficient.
Add some docstrings and code separations.
Prepare future code change.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
Rewrite code parsing name (_parse_partner_name) to make it easier to
understand. Tweak find_or_create to return directly a recordset with the
found partner / new partner instead of a name_get result.
Also inherit Partner.find_or_create() in mail in order to benefits from
email_normalized field, allowing to improve the search on matching emails
and avoid duplicates.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
PURPOSE
Perform some code cleaning in mail module
SPECIFICATIONS
mail.address.mixin is used only for mail.thread.blacklist mixin. Let us
merge those two and simplify class organization.
LINKS
Task ID 2222033
closesodoo/odoo#48115
Related: odoo/upgrade#967
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Remove dead views to clean dead records
SPECIFICATIONS
Find unused views and remove them, notably specific views that are not used
anymore because generic one is always taken. Notably
* view_partner_short_form: a short form view on partner that is not used
anywhere anymore. Indeed it has a priority of 2 whereas default form view
has a priority of 1 (lower better). It is not referenced in actions
anymore. It is therefore dead.
LINKS
Task ID 2196317 (Social/Marketing specific)
Purpose of this task is to prevent users from setting portal users on
internal documents by mistake, and preventing noise and performance
issues resulting from loading all the portal users in those fields.
This commit fixes internal many2x fields to res.users which are now
restricted to internal users by setting domain (share=false) on form view.
closesodoo/odoo#47553
Taskid: 2172779
Related: https://github.com/odoo/enterprise/pull/9204
Related: odoo/enterprise#9204
Closes: #47553
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.
When a user is Out-of-Office, the return date is displayed as "Invalid
date" on Safari (both iOS & macOS).
The parsing of the date returned by the server was done using the Date
constructor and passing the string as-is. This constructor delegates the
parsing to the `Date.parse` method. But the DateTime format used to
stringify dates in Odoo doesn't fully follow the ISO 8601, as required
by `Date.parse()`:
expected format: "YYYY-MM-DDTHH:mm:ss.sssZ"
actual format: "YYYY-MM-DD HH:mm:ss"
Also, Safari applies more strictly to this requirement than Chrome &
Firefox, resulting in a parsing error in the former browser.
This commit fixes it by using the utility function `str_to_datetime`
from `web.time` to correctly parse this date, independently of the
browser used.
NB: as this issue is browser dependent, no test has been added.
References:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Datehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parsehttps://tc39.es/ecma262/#sec-date-time-string-format
Task ID: 2198486
closesodoo/odoo#47987
X-original-commit: b85a44aea9617b9018dd80d5f8159354bbc88f09
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Update the 'createDisuss' helper to be appended to the DOM using 'dom.prepend' to
benefit of its 'on_(attach|detach)_callback' calls. This allows the mail test suite
environment to be closer to the actual action behaviour (having those methods called
each time it is created/destroyed).
Some tests in which these methods were manually called have been adapted.
Also, one of the tests was destroying the action too quickly and exposed an issue
within the Discuss action, in the 'on_detach_callback' method. It has thus been
fixed as well.
Create an Email Template without email_from
Create Server Action with Send Email
Establish email template as one created
User will be blocked because the template does not have a valid
'email_from'. This does not seems to be useful since the send action is
run via contextual menu, so the message by default will have the address
of the user performing the action.
opw-2213526
closesodoo/odoo#47703
X-original-commit: e083278fe18d491c487e6af4c9ac923acd36c74a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Use of the new control panel helpers to increase consistency and change the assertions
according to the new DOM/behaviour (e.g. components removed instead of turning invisible).
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Adaptation of the code throughout all modules to properly instantiate the newly
refactored control panel and update it accordingly.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible
The logic of the affected code remains the same.
MailThread._mail_search_on_* was obviously never called with an
extra_domain yet, or it would have raised an exception: expression.AND
expects only one argument, with the list of expressions to AND, and here
we were passing them as *args.
closesodoo/odoo#47585
X-original-commit: b20c5350c4d0e0e140f8824e6f5d2a0009af9810
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
PURPOSE
When incoming emails bounce due to alias security bounce email is quite
generic. Purpose of this task is to ease its customization and update.
SPECIFICATIONS
In order to improve the flexibility of alias, add a customizable html field
on the alias model. This html content will be send as bounce email core content
in case of bounced/unauthorized mail received for this alias,
Obviously it has no effect on 'everyone' security setting as no email will
bounce due to that issue.
If it is not set a default generic mail will be send depending on security
setting. It allows to keep void html fields when no specific bounce content
is required
In HR, an old template allowing some light customization for employee based
security option is removed as it is completely replaced by the new feature.
Also add references message-id of the mail received to the answer so that
threads are correctly set.
LINKS
Task ID 2126509
Open every model with the chatter
Schedule an activity
Click on "Done" button and insert a feedback with an accent/quote.
Escaped sequence will appear as result.
In v13 the html feedback field which was used to store feedback
was replaced by the mail subsystem, so the value should be sent to the
message_post_with_view unescaped
opw-2209081
closesodoo/odoo#46985
X-original-commit: d66c676e6a49cbf4cfcdae014c3b5e80dd7920d2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Fine tuning of 1e411e3a6d
- It moves the attachment in the message when we mark an activity as
done.
- It adds a test
OPW-2196668
closesodoo/odoo#47349
X-original-commit: 2033066426a6af6eed5f80f1bcde6e650e998f0d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
from `message_format` and from `_message_read_dict_postprocess`.
The reading and initial formatting is done by `_message_read_dict_postprocess`,
which has been renamed more simply to `_message_format` due to its new goal.
This makes the methods easier to follow and does not increase the query count.
It actually reduces it when the data were already in the cache, by not always
reading them again.
Part of task-2180311
PR: #43841
This makes the method easier to follow and does not increase the query count.
It actually reduces it when the subtype data were already in the cache, by
not always reading them again.
Part of task-2180311
PR: #43841
in `message_format` and in `_message_read_dict_postprocess`.
This makes the method easier to follow and does not increase the query count.
It actually reduces it when the notifications and tracking data were already in
the cache, by not always reading them again.
Part of task-2180311
PR: #43841
in `_message_read_dict_postprocess`.
This makes the method easier to follow and does not increase the query count.
It actually reduces it when the attachment data were already in the cache, by
not always reading them again.
The `has_access_to_model` is removed and replaced by `sudo` because:
- from portal everything is sudo so it's pointless to check access on top of it
- from backend, it's almost impossible to trigger the case, and it's not like
returning is_main True would leak any sensitive information to an employee
Part of task-2180311
PR: #43841
Currently, when clicking on the systray activity action icon and click on any
record from the activity, kanban or list view, not redirecting to its form view.
This commit adds the form view for that action and now click on record will
redirect to its form view.
task-2198480
Closes https://github.com/odoo/odoo/pull/46877closesodoo/odoo#47208
X-original-commit: 3fd30316c0af9a6ca2ea4962f2e2f832e68dee54
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Purpose
=======
The current kanban view is messy. It is difficult to identify which
apps are installed or not. The user can completely miss a module
that might have interested him. A search panel would make things way
more readable.
closesodoo/odoo#44401
Taskid: 2181557
Related: odoo/enterprise#8144
Related: odoo/upgrade#879
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The chatter's attachment box has an horizontal overflow when adding at
least 1 attachment.
This is due to a negative margin applied on the attachment list/previews
not matching its container's padding (3px vs 5px).
This commit reuses the SCSS variable dedicated to this margin around the
attachment list/previews and apply it correctly to the chatter's
attachment box.
Task ID: 2194025
X-original-commit: 3a7eb3fe97541855ae893514f8b98cbfe6c1a7e4
A horizontal scroll appears on medium to large screen sizes in the
form's chatter sidebar (e.g. between 1534px and 1619px, when all modules
are installed).
This commit restores the padding set by Bootstrap for `.nav-link`
elements instead of a fraction of the grid gutter's (?) width then
applying slightly smaller padding.
Task ID: 2193950
X-original-commit: 7bc8b577d822b057d1bccf881b9c4b1ee127a728
Issue
- Install CRM, Discuss
- Have 2 languages (e.g. french english)
- User 1 > French
- User 2 > English
- Create an activity as user 1 for user 2
- As user 2, check discuss > history
Notification received in french
Cause
mail_activity action_notify method uses
the context language which is the active
user language.
Solution
If user 2 has a language set, use this
language for translating body template (self)
and activity type (activity)
OPW-2205409
closesodoo/odoo#46800
X-original-commit: ccfe573b4eee82de92d130addb745f68b3fd3bd9
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
When mailgateway receives an incoming email being a reply to a thread but
containing a recipient being an alias linked to another model, it is
considered as a forward to that new alias. It therefore skips the reply
step in routing and applies rules related to new thread, aka checking
all recipients.
Consider this use case: receives a email on a task from "project@domain"
project being the alias of the project which creates new tasks when not
routing replies. Reply / forward it to "project@domain, sales@domain" in
order to transfer it to the sales team (sales alias creates new leads).
As this is a forward, both aliases are evaluated, leading to a new task and a
lead which is not what we expect.
We solve this issue by removing alias linked to the ignored reply model
when considering recipients.
PR #46764
Task ID 2121551
closesodoo/odoo#46784
X-original-commit: 7cff7787cb42cc9d3d0cb4c5af41a9f09d59d1ff
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
/!\ This commit is a manual forward-port of two PR targetting originally
11.0: #40442 and its fix / partial revert #41042. /!\
Purpose of this commit is to check all recipients of incoming emails when
trying to determine the route to apply. Notably
* an incoming email should be considered as a write to catchall only if all
recipients are catchall. Catchall + a valid alias should take the alias
into account;
* an incoming email sent to the bounce alias should be considered as a bounce
even if another valid alias is in recipients and whatever the order. Indeed
it indicates an issue and bounce is considered as more important;
* forward to an alias linked to another model should check all recipients
and not only the first one. Otherwise reply_alias, forward_alias is
considered as a reply whereas it should be considered as a forward when
considering all recipients;
Tests are added according to those specifications.
Please see original PRs for more details about the content, the comments
done on it and the various discussions.
PR #46764
Task ID 2121551
X-original-commit: df00bd2d3bddf9a2b56e8554380669025e146d21
Currently, to activate/deactivate records with the 'active' checkbox
user has to switch to edit mode of the form.
So the purpose of the task is to allow the user to activate/deactivate
records from the readonly mode of the form view.
In this commit, we set widget='boolean_toggle' on the 'active' field in form
view.
closesodoo/odoo#46567
Taskid: 2206794
Related: https://github.com/odoo/enterprise/pull/8918
Related: odoo/enterprise#8918
Closes: #46567
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When there is no intersection between the allowed companies of the current user
and the target user, the `with_user` would lead to the company check always
failing.
opw-2197955
closesodoo/odoo#46606
X-original-commit: ceee2c05f8a4fc69b8ae34469ac56a055ba7b7cf
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
When a user is created, its partner_id shall not have any company_id.
A test has been added to check that in 'base/test'.
Update test_mail tests by setting a company to partner_id linked to users
as now, by default the partner linked to a new user has no company_id.
closes odoo/odoo#46515
Task: 2198688
Forward-port-of: #45900
X-original-commit: 187b12fc5715721efdd9af283e086dfc3f856fc2
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit fix the o_mail_preview_image css by applying the same
rules as desktop.
Task ID: 2200099
closesodoo/odoo#46328
X-original-commit: f4a106c7fa5ba21bba2811d5c51cbf5bf57f4dc9
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Revision on https://github.com/odoo/odoo/commit/8e5b6ab02aa95c204ea7bd241e6b8944d5972d43
Intent of commit above was to remove server-side synchronization of
chat windows in mobile. To do so, it prevented sending RPCs for chat
window state in mobile, in addition to not automatically adapt state
of chat windows in mobile from longpolling notification.
This implementation, while functionally working as intended, had
disturbing intermediate logic that could potentially lead to bugs
in the future. Specifically, on mobile, new channel did not directly
trigger a re-render of discuss widgets. However, and thankfully, the
related new message was triggering the rendering, so that UI
correctly has channel and its notification.
This commit simply improves code so that new channel always triggers
a rendering, even in mobile, like before the commit above. Of course,
to preserve the intent of not synchronizing chat windows in mobile,
new detached channels must still not auto-open a chat window, and
this commit clarifies this intended behaviour in the code.
X-original-commit: 1046d063ca46aacb1e186599b5d4a02ef9c8e18d
Follow up of be06eb47bdf8b5f2cc281e3986818faf59e3a616 . Even if postgresql < 10.0 is not officially
supported this fix allows to keep compatibility with older postgresql.
closesodoo/odoo#46243
X-original-commit: 7e218be37cf0bc2c2c4fd4284b93ba99de679692
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently the message for help tooltip of auto_delete field is not sufficiently
clear for user to understand.
In this commit, improving message for help tooltip by adding some extra details
in it so user can easily understand about it for models mail.mail, mail.template
and wizard mail_compose_message.
Task-2055702
Closes https://github.com/odoo/odoo/pull/45063closesodoo/odoo#45063
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When using the Discuss app (not the systray's thread window) on a small
device, it is not possible to scroll through the discussion (cf. tab
"Chat" or "Channels").
Steps to reproduce:
* Go in discuss (in mobile)
* Go to tab chat or channel => BUG
NB: you must have enough element to test the scroll
This bug is due to the commit odoo/odoo@3ad7706560.
Before it, the styles as interpreted by the browser looked like this:
.o_mail_discuss_tab_pane {
overflow-x:scroll; // explicitly set in discuss.scss
overflow-y:auto; // implicit ; due to the overflow-x rule
}
But by removing the overflow-x rule, the styles ware interpreted as:
.o_mail_discuss_tab_pane {
overflow-x:visible; // implicit ; due to the absence of overflow-* rule
overflow-y:visible; // implicit ; due to the absence of overflow-* rule
}
In addition, the parent element had an overflow: auto rule scoped only
for desktop-like screens.
This commit fixes this issue by unscoping the overflow: auto rule on the
parent, allowing to scroll the messages' list in both desktop-like and
mobile-like screens.
Reference:
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-xclosesodoo/odoo#45964
X-original-commit: f4b22af7ed28d3515d77bfd76691aba1129581b1
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
- In some cases when trying to open a discuss conversation a
traceback can occur because of the usage of a local variable
before its assignation.
closesodoo/odoo#45867
X-original-commit: 47bec812a36c1e41bdb525439dfd18a208e1dd79
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>