Access rights on messages are derived from the
access rights on the documents they are attached
to. Due to the karma-based nature of the forum
access rights, these do not automatically reflect
on messages, because they are not implemented as
access rules.
The check_mail_message_access() needs to be
overriden to achieve the same effect.
+ allow calling super().check_mail_message_access()
from new API (useful in forward-port)
Previously, when updating subscribers of a mail.thread, the default_{key}
arguments could override a {key} in the values.
e.g: for an new opportunity, the salesperson was overrided by the default user_id
This fix gives the priority to the values over the default_ in context.
opw-631741
When an mail alias for catchall domain was assigned, some checks were not done
and a empty list help was wrongly displayed. Thus two arrays and some inconsistent
messages were displayed.
This commit correct this behavior so only one arrow is displayed.
Another part of the issue, was an erroneous propagation of context which should
be solved by a futur commit.
opw-630673
When auto subscribing to a message
(For instance, change the ```user_id``` field on a record,
like an invoice)
The new user is notified of the last message of the thread.
He must be notified of the parent message as well,
to have access to the first message of the thread,
to prevent access rights issues to the thread.
This mechanism is applied in the _notify method
of model ```mail.message``` as well, for the same reasons.
opw-630286
The previous matching rules were too fuzzy and allowed random
prefix-match or tail-match of other user's emails.
For example when looking up a partner matching 'foo@bar.com'
the system would sometimes find 'dom.foo@bar.com' instead,
or 'foo@bar.com.tw'.
Fixed by only allowing direct case-insensitive email match
of an addr-spec, or substring match of the addr-spec enclosed
in angle brackets, within a name-addr pair.
See also RFC5322, section 3.4
Also adapted related message_find_partner_from_emails() method
to factor out the partner email resolution mechanism to avoid
the same problem.
Adds corresponding regression test.
To allow customization, such as do not send the notification to the partner that subscribed himself to the thread (he probably already read the thread, no need to send him an email)
The old-api model._all_columns contains information about model._columns and
inherited columns. This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...
This commit contains the following changes:
- adapt several methods of BaseModel to use fields instead of columns and
_all_columns
- copy all semantic-free attributes of related fields from their source
- add attribute 'group_operator' on integer and float fields
- base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
payment_acquirer, share, website, website_crm, website_mail: simply use
_fields instead of _all_columns
- base, decimal_precision, website: adapt qweb rendering methods to use fields
instead of columns
And fallback of any type if there is none of type email
This fix allow the communication between two mail thread from two different Odoo servers having message creation subtypes, like project issue or crm lead
If an email contains several text/html parts inside a multipart email, the previous code was only keeping the last content part.
The Content-Type: multipart/mixed allows several independent part (RFC1341 7.2.2), so two html is technically valid.
With this patch, the two parts are concatenated. (opw 614755)
Modify append_content_to_html regex to make sure the regex keeps the content of the html instead of removing it.
e.g.: "123 <html> 456 </html> 789" used to be stripped to "123 789" while we expect "123 456 789"
Indeed using fromkeys with a list / dict as argument leads to the creation
of shared list / dict. This could create some ugly side effects when
used in loops. This commit fixes or cleans this kind of statement to avoid
unwanted side effects.
When parsing incoming messages, ignore white-space around
In-Reply-To headers, and extract message-id items inside
the References header using a regex.
This actually serves as a workaround for broken MTAs
mangling References (such as outlook.com nesting past ones
with commas, violating RFC2822).
Closes#516 as a manual rebase.
leading to potential issues.
Now the behavior is back to its previous version, posting on the user creates a private
discussion. Fixed management of model variable in message_post to avoid posting messages
on the mail.thread model.
Classic inbox writes on partner, with hr it writes on the employee profile, like previously.
management to access documents in notification emails, as well as for the
'view quotation' link in portal_sale module.
models: added a get_access_action method: basically, returns the action to
access a document. It uses the get_formview_action by default (form view
of the document). However for some documents we want to directly go to the
website, leading to an act_url action for some documents. This method allows
this behavior.
portal_sale: get_signup_url now uses the mail.action_mail_redirect method
instead of directly redirecting towards a portal menu. This allows to fall
back on a standard behavior.
portal_sale: get_formview_action updated, to match actions tailored for
portal users.
website_quote: get_access_action of sale order updated. If the sale order
has a template defined, the returned action is an act_url (website view
of the quotation), not the form action anymore.
mail: fixed signature + company signature in notification emails. Even without
user signature, the company signature + access link should be correct.
portal: signup url in notification emali was not using the mail redirection
as action. It is now the case.
When a record is created, if it inherits from mail.thread, a message 'OBJECT created' is posted. 'created' is translated but the name of the model wasn't.
This fix uses the name of the linked ir.model which is already a translatable field.
lp:1262000, opw 611043
Loading the menus is the most expensive
operation for an average page load, and
the result does not change often.
The menu filtering already uses a separate
cache based on groups, but the rest of the
loading includes reading actions and
translating menu names, which is also
expensive.
Added a cache keyed on user + user
lang, plus relevant cache invalidation
when any of the following are touched:
access rights, user data including
groups and language, menus or mail.group
subscriptions.
The menu filtering cache is still
useful in parallel has it is invalidated
under different conditions.
User.has_group() is cheap but still
called very often, so it is an easy
win as well, and also frequently
used when rendering page templates.