Purpose
=======
Currently fields with a `groups` attribute can't be tracked.
Otherwise changes would be visible by all in the chatter, including
users which normally don't have the access rights because they are
not members of `groups`.
Specification
=============
Filter tracking field values according to the `groups` attributes.
Users without the access rights should not see them.
If a message is only composed of tracking values and the user doesn't
have the rights to see them, an empty message should not be displayed.
This commit changes some methods so they can be used in the account_documents enterprise bridge
and adapts activity tests for the new request on upload_file feature.
task: #1928404
related to: odoo/enterprise#3607closesodoo/odoo#30950
Before this commit, when creating a partner automatically when creating
a message with a template, the company on the partner was wrongly set
After this commit, we try to retrieve the company from the model on the template
OPW 1934392
closesodoo/odoo#30893
1) Configure both an incoming mail server and an outgoing one.
2) Install CRM.
3) Create a sale team, use the incoming mail address as mail alias.
4) Add a user with a valid email as follower of that team in the
chatter.
5) Enable developer mode, become super user via the developer tools.
6) Change the language of the super user to french.
7) You may want to modify the default gather/post time interval.
to receive/post email more regulary in the scheduled action.
8) Using an external mail client, send a mail to the incoming mail
address.
9) Let the two scheduled actions run by themselves.
10) The mail sent to the user has the "Lead/Opportunity" in english
wheras the rest of the email is in french.
opw-1917993
closesodoo/odoo#31034
As `formataddr` only accept strings as arguments, an exception was
raised when trying to notify a mailing list channel with followers
without email.
closesodoo/odoo#30492
This commit fixes the following issues regarding the mail tour:
1. Start from discuss app (not app switcher)
2. Adapt from recent changes on discuss app https://github.com/odoo/odoo/commit/9f6f9c71d3258ce3652b4a5793b7dcfef6f01d25
Note there is an error if we let runbot run this tour automatically:
```
Tour mail_tour failed at step Messages can be <b>starred</b> to remind you to check back later.
(trigger: .o_mail_discuss .o_mail_thread .o_thread_message_star)
```
This comes from the mail tour requiring longpolling to work, which is
intentionally disabled when running tours automatically on runbot.
We plan making this tour run without longpolling in the future, which
requires a design change from the client code (e.g. reduce reliance
on the longpolling).
Task-ID 1916093
closesodoo/odoo#29575
Do not use the model `_description` field which cannot be translated. Use
the `display_name` of the corresponding model instead.
Moreover, `<t t-esc="'%s' % model_description or 'document'"/>` gives
`'None'`, while `'document'` is expected.
This adds a query to some tests, which is expected since `display_name`
requires information stored in the DB, while `_description` is defined
at the Python level.
opw-1908420
On test fixes: Because the company now have parenthesis in its name,
formatting email addresses adds double quotes around the name.
e.g.: "My Company (San Francisco)" <example@exmaple.com>
This is related to revision
71f188082f
This is nice to have a meaningful explanation
for the user to understand why his mail is not sent,
this is better to not interrupt the mail queue when doing so.
Because of the above revision,
when the mail queue iterated on a mail failing because
of an ASCII encoding issue,
the mail queue was interrupted,
and on the next cron call it failed again and again
on the same mail, therefore leading to the mail queue
to never be processed.
Fixes#27804
When a letter is sent through snailmail and encounter an error, it used
to create an activity to the user to notify him that there was an error
with its letter.
When a user had this activity, he didn't have any clues of what was the
error and how to manage it. So we decided to better handle snailmail
errors and give the possibility to the user to easily fix the source of
the snailmail errors.
First to give a better feedback on the letters in errors, we've made
features similar to ones existing for emails:
- We add a mail message on the document that sent the letter, and put a
small paper plane icon, which is red when an error occurs (like the
envelope for email)
- As letters can be sent in batch, we've also added an entry in the
systray to easily manage the different documents having snailmail
errors like for emails.
Then we identified, the most common errors encountered with the
snailmail letters and give proper way to let the user fix them:
- Missing Required Field:
- The address is not complete, some of the fields are empty.
- We open a wizard allowing the user to modify the partner address
and we try to resend all letters having this error on the modified
partner.
- We also try to avoid this error, by opening the wizard before
sending the letter, but it only works for single documents, not
for batch.
- Trial/Credit Error:
- The user has not enough credits to send letters anymore.
- We open a wizard that give a redirection lnk to add credits on its
iap account.
- No Price Available:
- The destination country is not supported by any of our providers,
and we cannot do anything to send this letter.
- Format Error:
- The format of the pdf report send by the user is refused by our
providers, because some visual stuffs are not respected, for
example blank zone to print barcode or margins.
- We show a wizard to the user letting him check a setting option
that add a cover page in the envelope and the documents will be
send with this extra page containing the address.
- Unknown Error:
- This is not one of the listed error above.
- A wizard suggesting the user to contact support is displayed.
The cron that try to resend letters on error, has been addapted to only
try to send the error of type Trial/No Credit, because the account might
have been reloaded, and other errors, won't change if they have not been
fixed locally.
closesodoo/odoo#29685
This commit introduces the "upload file" activity type
category. For an activity of that time, uploading a file
will mark the activity as done (and maybe create the forced
next activities).
This activity type is seen as a shortcut to upload a file
with a reminder.
Task-1915004
closesodoo/odoo#29861
The current implementatipon of write on mail.activity will
send a notification to the user every time a write is made
on user_id.
To avoid to send notification / mail if the user_id is given
but doesn't change, we can simply filter the records. This
will also avoid to check assignation rights in this case.
Task: 1905086
closesodoo/odoo#30055
Purpose is to clean the use of tracking parameters on fields. Parameters are
merged and is now tracking=<int> or tracking=True.
This commit is linked to task ID 1903814 and PR #28430.
As activities are created using the current user there is no need anymore to
have another field to store the activity creator. We can therefore remove
create_user_id and replace its use by the magic create_uid field.
This commit is linked to task ID 1856417 and PR #27619.
This commit improves code of access rights checks when creating or updating
activities. Several points triggers this commit
* we would like to use _filter_access_rules and override it on activities
model in order to be more standard;
* we would like to get rid of sudo used in various CRUD overrides as using
standard ORM method allows to correctly use current user;
* we would like to get rid of create_user_id field once we can keep the
current user as create_uid;
Access rights are a bit updated. They are now the following
* you can create activities for documents like posting messages (using
_mail_post_access attribute; if not defined, write access on document
is required);
* you can read activities for documents you can read;
* you can write and unlink activities either following the defined access
rule (created OR assigned), and otherwise like posting messages (
using _mail_post_access attribute; if not defined, write access on
document is required);
In this commit we also hide edit / mark as done / cancel buttons for
activities the current user cannot modify.
This commit is linked to task ID 1856417 and PR #27619.
Co-Authored-By: Sébastien Theys <seb@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
When a record inaccessible by the user is linked
to a message in a channel accessible to the user,
Avoid to raise an access error due to this linked record.
Also need an aditional query in test query_count.
closesodoo/odoo#28312
Currently creating activities assigned to user not having to the document
raises an Error as people should not have activities they cannot handle
directly on a document they cannot access.
In some cases activities are created through business flow, like automatic
activities creation when creating leave requests. Assigning an activity
to someone that has no access to the document should not prevent from
creating the leave request.
This commit therefore does not check assigned user access on automated
activities to avoid having blocked business flows.
This commit is linked to task ID 1903484.
closesodoo/odoo#28139
Commit 356a421660 introduced a hook to avoid sending emails while
installing application data. However we have to carefully re-activate email
sending in tests that depend on them especially performance tests.
This commit also update performance counters to match the current state of
counters as it was not totally updated.
Commit linked to task ID 1902307.
When sending notifications by batch one notification email can be send
up to 50 people. For one mail_mail entry to handle 50 emails can be sent
as those are sent independently for each recipient.
In some cases a bounce may occur while the whole batch of recipients is
not completely mailed. In that case the mailgateway will update the
notification status to bounced. When the cron finishes to send the whole
batch of emails it tries to update the notifications of all recipients.
However as a notification has already been updated due to the bounce we
face a concurrent update, meaning the transaction is rollbacked.
Emails have been sent but notifications are not considered as sent as they
have not been updated accordingly. Next time the cron runs it will send the
same batch again, with probably the same bounce and rollback. We could
therefore face an email loop.
This commit add test for this use case.
This commit is linked to task ID 1893054.
Purpose of this commit is to use the newly introduced helper to create
test users in a quick way and reduce code duplication. A mail specific
helper tool function is defined based on the standard one defined in test
allowing to pass a custom context. It bypasses mailing features in order
to speedup the creation.
This commit is linked to task ID 1889703 and PR #27526.
When sending notifications by batch one notification email can be send
up to 50 people. For one mail_mail entry to handle 50 emails can be sent
as those are sent independently for each recipient.
In some cases a bounce may occur while the whole batch of recipients is
not completely mailed. In that case the mailgateway will update the
notification status to bounced. When the cron finishes to send the whole
batch of emails it tries to update the notifications of all recipients.
However as a notification has already been updated due to the bounce we
face a concurrent update, meaning the transaction is rollbacked.
Emails have been sent but notifications are not considered as sent as they
have not been updated accordingly. Next time the cron runs it will send the
same batch again, with probably the same bounce and rollback. We could
therefore face an email loop.
This commit fixes that by setting notifications to a transient exception
state. Notifications are locked, meaning bounced will have to wait for the
transaction to finish before updating them. That way the cron can run
safely on the whole batch and we avoid having emails loop. It has an impact
on query count as a search and write is performed in the send process.
This commit is linked to task ID 1893054. Done in collaboration with
@Xavier-Do .
Sending email to addresses containing unicode characters
cannot be parsed by python and result in a UnicodeEncodeError.
This PR catch that specific exception and output a meaningful
error message.
Decision has been taken to not trigger any error message
client-side has it would have needed modifications on some
sensitive low-level backend code.
To reproduce:
- Configure odoo so it uses an email server
- Send an invoice to a partner whoose email address contains
some unicode characters (exemple: æøåÇÀ@example.com)
opw-1892409
closesodoo/odoo#27804
Purpose
=======
display_name is equal to doing name_get()[0][1]
Replacing name_get()[0][1] by display_name could be good for 2 things:
- Uniformization of the code
- Probable optimization if name_get is used inside a for loop on a recordset (as the values will be prefetched and put in the cache).
TaskID: 1849250
closesodoo/odoo#26341
Before this commit odoobot was appearing twice in mention
suggestions when talking to odoobot.
The initial need to be able to ping odoobot from everywhere led to the
override of channel_fetch_listeners. This is not usefull anymore.
This fix simply removes this override to avoid this problem since we
don't have a real use case where we need to ping odoobot in another
channel.
Task 1907142
closesodoo/odoo#28791
This tour was broken since the following refactoring:
https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c
With this commit, mail_tour should work correctly, and
is automatically run on runbot.
Note that the tour is automatically run in the module `test_mail`,
so that the tips are not displayed by installing Discuss.
Task-ID 1912730
closesodoo/odoo#29040
Before this fix the creation of task assigned to admin was leading
to the creation of mails.
This is a generic fix to avoid to notifiy a user when he is add as a
follower when creating data from odoo data files.
closesodoo/odoo#27682
Purpose is to separate tests related to access rights (low level), base
activity features and mixin itself. It eases understanding of tests and
prepare future addition of tests.
This commit is linked to task ID 1856417.
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.
Related Task ID : 37311
This is done by adding a new field on mail.thread objects and setting it when posting a message with attachments on a model inheriting from mail.thread.
Was part of PR #26740
Was part of task #1880089