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"
In some specific conditions (e.g. admin logging during cron run, concurrent update), writing on the mail object may fail, triggering a rollback of the transaction.
As the write was done after the SMTP sendmail action, an email could be sent twice (state not correctly put, would be retried at next process of the email queue).
This patch provoke the error before the sendmail action and thus avoids sending the email.
Fixes#552
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.
when the user is not registered, the announcement bar messed up the
layout by adding a third scrollbar. This commit fixes the issue by
ajusting the height if necessary. The timeout is necessary to prevent
a scrollbar from appearing when the animation is running.
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.
violated in _search, do it in SQL to speedup the query. Indeed doing it via search and
browsing the results to validate the various rules is quite costly.
when the email is not a notification, or not an email usign the automatic
threading. This means that when doing mass mailing with a fixed reply_to
there won't be any link to access the original document, which is what
we want. Otherwise when mailing partners, they have a link to access
their own partner profile, which does not make sense.
The forward port of the fix 3609ba10f2 will be done separately, as the mrp scheduler has been completely refactored from saas-5.
Conflicts:
addons/l10n_be_coda/wizard/account_coda_import.py
addons/point_of_sale/static/src/xml/pos.xml
addons/procurement/schedulers.py
This avoids storing useless "{}" values
in the database when there are no headers,
and avoids having to update all existing
entries when this column is added.
Just requires simple tests before evaluating
the headers contents.
- [FIX] bounce regex: too many emails were considered as bounce and therefore
not displayed in the chatter and lost for the communication history. The regex
was not correctly looking for the bounce alias in the email_to.
- [FIX] invite email: replying to the invitation email (invitation as new
follower) now replies to the user sending the invitation.
- [FIX] mass_mailing: added a column to store the id of the original email
in addition to the many2one column. The many2one is set to null when deleting
the original email. As the information is necessary, it is saved on another
field. The many2one is necessary for indexes purpose as the inverse of
a one2many.
This can give a performance boost on large databases
and should not be a concern in terms of access control
as the inheritance already grants access to the parent
records.
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 creating a new message, we need to reset the default_type key to avoid context propagation (e.g. invoice menu).
However we used to compare the key in context (char) with the list of selections (tuple) so it was never matching and always reset.
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
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages
(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)
Closes#1260
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.
Replacing the browse+search speeds up
the filtering 50x, which is significant
for a method that may be called on most
page loads as soon as the user is
logged in.
Many mail clients will replace the name in the To:
header with Me if the To: email matches the email
of the user. These users will see To: Me instead of
"Followers of ..." and usually believe this was a
private email from the sender to them.
But when replying they would reply to the whole list.
Fix this by explicitly forcing the To: to be the
mailing list address.
- remove the default footer for mail.group messages,
replace with specific footer with archive and unsubscribe
link
- remove the automatic addition of user signature in
mail.group messages, as many of them will be posted
via the mail gateway and already contain a user signature.
- make it easier to unsubscribe even when not logged in,
as followers who have not signed up will have no
way to login short of signing up.
- remove tests looking for user signature in mail.group posts
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.
- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
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.
[FIX] mass_mailing, website: fixed unsubscription link, fixed mobile preview of email designer crashing because of the redirection not taking search parameters
[MERGP] Inline Searchview
This task split the searchview in two parts: SearchView and SearchViewDrawer. The drawer is displayed inside the main view and the searchview stays in place. It also changes the scrolling behavior of the web client: the main view area can scroll without affecting the UI (so the various menus stays in place)
Because of this, other large changes have been made:
the drawer has been redesigned,
the Custom Filter widget has been split in two (Custom Report and SaveCurrentFilter),
the main view is now scrollable, so the UI stays in place and only the view can change
The text 'Group By...' has been changed into 'Group By' (most addons had to be modified)
bootstrap classes are used when it makes sense (for example, badge)
the left menu is also scrollable (separately from the main view)
It is likely that some stupid bugs have been introduced. Please don't hurt me.
- added possibility in mail to have a model adding custom headers in emails sent for notifications for new messages
- mail.group now add list-id and precedence: list in the headers to inform mailing systems that those mails are to be considered as mailing lists
- website_mail_group adds some further data in the headers (subscribe, unsubscribe, archives)
- groups page now display the number of message in the last month
- notification emails are now queued after 50 recipients
The problem was that the do_searchview_search callback was registered
after the event 'search_data' was triggered. For some reason, it
waited that the searchview was appended instead of registering directly.
- fixed keeping the original message for routing, only when choosing to reply in the
original thread (notification=True)
- auto delete sent emails explicitely
- mail_thread: routing: fixed replies always choosen even when replying to emails
with a specified reply_to (using ref_match in the algorithm)
- mail_thread: routing: instead of exclusive routing heuristics, use each case
as a fallback of the previous.
Be careful, content-type may contain tricky content like in the
following example so test the MIME type with startswith()
Content-Type: multipart/related;
boundary="_004_3f1e4da175f349248b8d43cdeb9866f1AMSPR06MB343eurprd06pro_";
type="text/html"
same_thread boolean field of mail.compose.message model define wether or not replies should be posted in the thread or not
On composer creation, this boolean should be passed according to the reply_to_mode of the mass_mailing
Otherwise, all replies would be posted in the thread, and the reply_to will be ignored (if same_thread id True, reply_to is poped from the mails values, mail/wizard/mail_compose_message.py:284)
the height of the oe_view_manager_header is variable, and the top can't
be positioned correctly with pure css without a lot of work, so this
commit adds a touch of javascript to make sure that the view is
correctly positioned.
the mail menu is a client action, so not subject to the same template
as regular views. so, it had to be patched to properly scroll like
other views (meaning: the 'header', left menu and top menu are fixed)
Also, changes the width of the searchbbar into a min-width css property,
to allow it to grow more. The reason is that we don't want the searchbox
to take two lines (or more), which will force the view_manager_header to be
higher, and which will cause slight issues with the scrollbar (absolutely
positioned)
opw-608251: When coming from website > My account, and clicking on a lead link from a message in the inbox, and then deleting the lead, the history_back is triggered and we come back in the website, while we should have come back in the inbox. This is because the action performed was not pushed in the breadcrumb
after some thought, the extra method insert was not really necessary.
It was at first a way to force the user to give two nodes to determine
where the searchview and the drawer were to be inserted. However,
the second node can be omitted, a perfectly reasonable default is
to append the drawer just after the searchview.
Then, the role of insert is exactly the same as appendTo, so it makes
sense to override appendTo and remove insert. Simpler, and the job is done.
Before, the searchview and the searchview drawer had to be instantiated by
the user and appended separately to their correct place. Now, the
searchview is responsible for creating/destroying the drawer, and the
user is responsible for correctly using the insert method with
the node where the searchview/drawer are to be inserted.
incomplete work. So far, the search view widget has been split in
two widgets: SearchView and SearchViewDrawer. The SearchViewDrawer
has been inserted inline, and some preliminary work has been done
to improve the layout.
* added a ``tracking_disable`` context key used by mail to completely disable
subscriptions setup and events generation during create and write operations
* added import option to optionally set up that context key and speed up
imports at the cost of not setting up subscriptions and not sending
create/update events
bzr revid: xmo@openerp.com-20140512100400-d1axjam2d0i2y0tf
* _get_tracked_fields should return a dict even when there's no tracked field
(return an empty dict)
* in write, only call _get_tracked_fields once, initialize to None instead of
a list (especially since it should be a dict in the first place)
bzr revid: xmo@openerp.com-20140507103056-ykr9f57yxpw1c542
Specifically when there are many emails in the queue, prefetching
all their attachments at once when processing the first one
could fail, so not even one mail would be sent.
Added explicit logging when an email triggers a MemoryError,
as well as logging when each email is successfully sent.
bzr revid: odo@openerp.com-20140502144431-r3brgagl4gel4wmt
This would permanently mark the mail as failed while
there is a good chance it will be sent properly next
time it is retried (provided the memory situation
improves or the server/worker has restarted).
bzr revid: odo@openerp.com-20140430102552-qkwv20b20nve64th