Commit Graph
7939 Commits
Author SHA1 Message Date
Tiffany Chang (tic) f9ff21a200 [IMP] mass_mailing_(sms): Add unblacklisting button
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
2020-03-26 10:15:18 +00:00
Tiffany Chang (tic) 3a112c7b78 [IMP] mass_mailing_(sms): Update UX
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
2020-03-25 15:58:42 +00:00
Luis González 5dda9a709e [FIX] web,mail: Harmful or incomplete aria-label attributes
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`

closes odoo/odoo#48317

X-original-commit: e3c7f66e89d7be39dfa4cc3d6b038c6f4a114aa5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-25 12:39:02 +00:00
Thibault Delavallée 3d86a29aeb [MOV] mail, various: move replace_local_links to render mixin
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
2020-03-24 10:24:44 +00:00
Thibault Delavallée 2835e0ba38 [MOV] mail, sms: move language computation in render mixin directly
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
2020-03-24 10:24:42 +00:00
Thibault Delavallée 822f468059 [MOV] mail: move rendering code to mail render mixin
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
2020-03-24 10:24:19 +00:00
Thibault Delavallée a03f6483d6 [REF] mail: clean code about rendering in mail_template
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
2020-03-24 10:24:18 +00:00
Thibault Delavallée aa31e67716 [REF] mail, sms: reorganize {mail.sms}.template and mail.render.mixin fields and add docstrings
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
2020-03-24 10:24:16 +00:00
Thibault Delavallée 6e25a510b3 [REF] base, mail: improve partner creation from name / email
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
2020-03-24 10:24:14 +00:00
Thibault Delavallée fd9b259026 [REF] mail: merge blacklist and address mixins
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

closes odoo/odoo#48115

Related: odoo/upgrade#967
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-20 14:58:44 +00:00
Victor Feyens bbce92b436 [REF] base, various: remove unused views
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)
2020-03-20 15:01:39 +00:00
Nisha patel e428d473c3 [IMP] various: Allow to select only internal users on m2x field with res.users
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.

closes odoo/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>
2020-03-16 10:28:35 +00:00
Victor Feyens a3ded9043d [IMP] *: declare ir.rule in noupdate
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.
2020-03-20 16:21:25 +01:00
Victor Feyens 532c083cbb [IMP] *: remove global field definition in ir rules xml
It is a computed field, there is no need to manually set its value.
2020-03-20 16:15:40 +01:00
Pierre Paridans eb724d9add [FIX] mail: correctly parse datetime returned from server
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/Date
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
https://tc39.es/ecma262/#sec-date-time-string-format

Task ID: 2198486

closes odoo/odoo#47987

X-original-commit: b85a44aea9617b9018dd80d5f8159354bbc88f09
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-03-19 09:38:07 +00:00
Julien Mougenot c9ce8a07e1 [REF] mail: update discuss helpers
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.
2020-03-18 14:51:35 +00:00
Thibault Delavallée ce77c64e63 [FIX] mail: fix typo in additional
Task ID 2211781

closes odoo/odoo#47937

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-18 15:38:22 +00:00
Andrea Grazioso (agr-odoo) 1b3f4c9144 [FIX] mail: remove constraint email_from from template
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

closes odoo/odoo#47703

X-original-commit: e083278fe18d491c487e6af4c9ac923acd36c74a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-16 13:36:24 +00:00
Julien MougenotandMathieu Duckerts-Antoine 804507ef49 [REF] *: Adapt all module tests to the new control panel
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>
2020-03-13 14:08:33 +00:00
Julien MougenotandMathieu Duckerts-Antoine e68d3bb09d [REF] *: Adapt all modules to new control panel
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>
2020-03-13 14:08:33 +00:00
Julien MougenotandMathieu Duckerts-Antoine 0a129284e4 [IMP] web,*: Enhance test helpers
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>
2020-03-13 11:39:53 +00:00
Julien Mougenot 384e516218 [REF] web: Update generic files
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.
2020-03-13 09:37:29 +00:00
Paul Morelle 828531d66f [FIX] mail: fix wrong calls to expression.AND
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.

closes odoo/odoo#47585

X-original-commit: b20c5350c4d0e0e140f8824e6f5d2a0009af9810
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-03-13 12:20:57 +00:00
Rémy Voet (ryv) c5e6511e8d [IMP] mail: ease bounce email content update based on alias security
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
2020-03-12 13:54:32 +00:00
Andrea Grazioso (agr-odoo) e47ba38456 [FIX] mail: do not escape feedback before sending to backend
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

closes odoo/odoo#46985

X-original-commit: d66c676e6a49cbf4cfcdae014c3b5e80dd7920d2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-05 13:50:46 +00:00
jvm-odoo 06dee038dd [FIX] mail: attachments in the message when marking activity as done
Fine tuning of 1e411e3a6d
- It moves the attachment in the message when we mark an activity as
  done.
- It adds a test

OPW-2196668

closes odoo/odoo#47349

X-original-commit: 2033066426a6af6eed5f80f1bcde6e650e998f0d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-11 09:49:02 +00:00
Sébastien Theys 5b87b5879c [FIX] mail: prevent hidden chat window close from opening home menu
opw-2210274

closes odoo/odoo#47245

X-original-commit: ca695425a2b06ffba15d7063fb0b8ea994f751d6
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-03-10 08:33:02 +00:00
Sébastien Theys e3afe4d067 [IMP] models, (test_)mail, portal(_rating): remove message_tree
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
2020-03-06 16:15:44 +00:00
Sébastien Theys 2490676e16 [IMP] mail, test_mail: simplify subtype in message_format
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
2020-03-06 16:15:44 +00:00
Sébastien Theys 04fda71e42 [IMP] mail, test_mail: simplify notification and tracking values
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
2020-03-06 16:15:43 +00:00
Sébastien Theys dca44f53a2 [IMP] mail: simplify partner in _message_read_dict_postprocess
This makes the method easier to follow and does not increase the query count.

Part of task-2180311
PR: #43841
2020-03-06 16:15:43 +00:00
Sébastien Theys ad5454f0ef [IMP] mail, test_mail: simplify attachment
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
2020-03-06 16:15:43 +00:00
Hiral Bhavsar 0712c5222c [FIX] mail: allow to switch on form view
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/46877

closes odoo/odoo#47208

X-original-commit: 3fd30316c0af9a6ca2ea4962f2e2f832e68dee54
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-03-09 14:03:25 +00:00
Yannick Tivisse 4c291e3f70 [IMP] base: Display searchpanel on ir.module.module views
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.

closes odoo/odoo#44401

Taskid: 2181557
Related: odoo/enterprise#8144
Related: odoo/upgrade#879
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-05 14:03:45 +00:00
Pierre Paridans a5dccc1586 [REV] mail: Move the attachment icon on the left
This revert of commit odoo/odoo@9cd3bcd440 is due to
the attachment's button needing to be kept on the right side of the
chatter's topbar.

Task ID: 2193950

closes odoo/odoo#46958

X-original-commit: d458aca28c25879ca9878b0628f2a6ea703504ef
Related: odoo/enterprise#9027
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-03-05 11:40:01 +00:00
Pierre Paridans 80c00af329 [FIX] mail: overflow in the attachment box
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
2020-03-05 11:40:01 +00:00
Pierre Paridans 5d88e164bc [FIX] mail: chatter has horizontal scroll on medium screen sizes
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
2020-03-05 11:39:59 +00:00
jvm-odoo bb1fa25615 [FIX] mail: fix activity notification language
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

closes odoo/odoo#46800

X-original-commit: ccfe573b4eee82de92d130addb745f68b3fd3bd9
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-03 17:53:33 +00:00
Thibault Delavallée 48d884678c [FIX] mail: route only to other models when routing a forward
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

closes odoo/odoo#46784

X-original-commit: 7cff7787cb42cc9d3d0cb4c5af41a9f09d59d1ff
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-03 16:25:01 +00:00
Thibault Delavallée 68a457e174 [FW][FIX] mail: correctly check all recipients when routing on aliases
/!\ 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
2020-03-03 16:25:00 +00:00
Nisha patel 159699b09c [IMP] various: set boolean_toggle on 'active' fields in form view
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.

closes odoo/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>
2020-03-02 06:26:02 +00:00
Sébastien Theys 974736306f [FIX] mail: allow to create channel with user in another company
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

closes odoo/odoo#46606

X-original-commit: ceee2c05f8a4fc69b8ae34469ac56a055ba7b7cf
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-02-28 17:06:10 +00:00
fw-bot 1d135ffc06 [FW][FIX] base: No company_id on new res.partner
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>
2020-02-28 09:19:19 +00:00
Hemali Bhimani caa0e52d4b [IMP] *: add Archived filter in models with active field
task:2026285
closes:#45779

closes odoo/odoo#45779

Related: odoo/enterprise#8581
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-26 10:01:05 +00:00
Romain Estievenart 806cb4aa43 [FIX] mail: preview image distorted on mobile
This commit fix the o_mail_preview_image css by applying the same
rules as desktop.

Task ID: 2200099

closes odoo/odoo#46328

X-original-commit: f4a106c7fa5ba21bba2811d5c51cbf5bf57f4dc9
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-02-26 11:18:00 +00:00
Alexandre Kühn 86fd7ab4f0 [FIX] mail: improve discuss new channel handling in mobile
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
2020-02-25 14:50:21 +00:00
Thibault Delavallée 965eef99d8 [FIX] mail: make followers computation compatible with postgresql < 10
Follow up of be06eb47bdf8b5f2cc281e3986818faf59e3a616 . Even if postgresql < 10.0 is not officially
supported this fix allows to keep compatibility with older postgresql.

closes odoo/odoo#46243

X-original-commit: 7e218be37cf0bc2c2c4fd4284b93ba99de679692
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-25 13:24:23 +00:00
Ipsita Borisagar 13eff43afc [IMP] mail: improve the help tooltip of auto_delete field
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/45063

closes odoo/odoo#45063

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-02-18 10:01:38 +00:00
Romeo Fragomeli 7e47742225 [FIX] mail: fix scroll in discuss on small screens
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-x

closes odoo/odoo#45964

X-original-commit: f4b22af7ed28d3515d77bfd76691aba1129581b1
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-02-21 15:20:18 +00:00
Toufik Ben Jaa 5ab518ce67 [FIX] mail: referenced before assignment error
- 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.

closes odoo/odoo#45867

X-original-commit: 47bec812a36c1e41bdb525439dfd18a208e1dd79
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-02-20 17:26:35 +00:00