diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-04-11 13:20:33 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-04-11 13:20:33 +0200 |
| commit | f8a2299525aefce9fd6fa383f204961383c600ea (patch) | |
| tree | a5c297be0598cb6765b4d056bb18a3446fbe45e7 /addons/project_long_term | |
| parent | 8c7cf300eb32b9b55c54a15451ab6e3633b4ce14 (diff) | |
| parent | 9e4486ae528e97e364e995b5bb3396f1e6b0dd84 (diff) | |
[MERGE] [FIX] mail, email_template: fix attachment duplication and clean attachment management
The way attachments are linked to the document has been cleaned. Posting method message_post may receives 2 arguments:
- attachment_ids: those linked to the wizard model (mail.compose.message) are linked to the document (res_model, res_id)
- attachments: the tuples are used to create new attachments linked to the document
The wizard does not set the res_model and res_id of attachments anymore, delegating this job to message_post.
The mail.message and mail.compose.message now use their respective attachment_ids field when possible. This is done instead of reading/creating new attachments based on the attachments tuple each time a mail.compose.message is processed. Email templates now also use attachment_ids, in particular when generating emails, instead of using the attachments tuple. Only reports are still generated on the fly and put into attachments instead of attachment_ids.
A cron job has been added to unlink 'lost' attachments. Those are attachments:
- linked to 'mail.compose.message'
- with res_id=0 (due Chatter used in minimal mode or reports generated by templates before the wizard has an ID)
- with no activity for more than one day (create_date and write_date)
bzr revid: tde@openerp.com-20130411112033-mqph9vjlcjkoolfs
Diffstat (limited to 'addons/project_long_term')
0 files changed, 0 insertions, 0 deletions
