Commit Graph

213 Commits

Author SHA1 Message Date
Christophe Simonis 7a7d7febf8 [MERGE] forward port of branch saas-3 up to revid 9429 chs@openerp.com-20140424123538-rxk9got9k2on1ki1
bzr revid: chs@openerp.com-20140424131824-4ksluvhnegp7kplb
bzr revid: chs@openerp.com-20140424134533-lhhcd32n3s0m9cqk
2014-04-24 15:45:33 +02:00
Denis Ledoux 2b2153bc39 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9991 revid:dle@openerp.com-20140417110435-u8uwwcf5ji1b54ao
bzr revid: dle@openerp.com-20140417112655-eeaiokbqzokpwx4i
2014-04-17 13:26:55 +02:00
Martin Trigaux 1ab962d338 [FIX] mail: convert attachments to binary as it is the expected format of message_post opw 604205
The double convertion (render_message and send_mail) is done to keep the API but should be changed in next version.

bzr revid: mat@openerp.com-20140415161441-q6pfueetvv0namgw
2014-04-15 18:14:41 +02:00
Thibault Delavallée 3eaeae55a0 [IMP] mail, mass_mailing: better recipientsz computation
for mass mailing, composer and template. This allows to have one method computing recipints
and avoid repetiting myself.

bzr revid: tde@openerp.com-20140415154700-zu2izvxfjq1k4h4a
2014-04-15 17:47:00 +02:00
Thibault Delavallée 272a7e5f80 [FIX] email_template: fixed error in default recipients calculation
bzr revid: tde@openerp.com-20140327141141-qe47tlnnfb5xt9s8
2014-03-27 15:11:41 +01:00
Thibault Delavallée 2dc0372431 [FIX] email_template: protect against possible non existent value
bzr revid: tde@openerp.com-20140325154006-fb5bu1khcvg6vdjb
2014-03-25 16:40:06 +01:00
Thibault Delavallée 8c270f9b87 [FIX] email_template: fixed iteration on a dict
bzr revid: tde@openerp.com-20140325142519-z3j1saqry9j23e0p
2014-03-25 15:25:19 +01:00
Thibault Delavallée 97d49659d0 [IMP] email_template: added an option to automatically generate
recipients instead of using template-based values. This should be the default way of using
templates actually, to avoid confusion with mako, ill-defined templates, ...

email_template code has been updated to handle recipient_ids when creating an email, depending
on its generated template values or default recipients.

mail_compose_message has also been updated, delegating the calculation of recipient when
having a template to the template itself, using some context keys to force the use
of partners instead of email_to and email_cc.

Also updated email_template form view to be a bit less confusing.

bzr revid: tde@openerp.com-20140325140324-bljvybigk3zv5ugm
2014-03-25 15:03:24 +01:00
Simon Lejeune 1c5a57a129 [FIX] email_template now use the new get_pdf method on the report model in order to avoid the blocking bug of generating a pdf with a public request.session
bzr revid: sle@openerp.com-20140319185350-5t8iuvnzikwfajei
2014-03-19 19:53:50 +01:00
Christophe Simonis d504764eff [MERGE] forward port of branch saas-3 up to revid 9298 chm@openerp.com-20140311130852-3ft0v1mc9ht1any6
bzr revid: chs@openerp.com-20140311145205-s56fj113fsrnisc3
2014-03-11 15:52:05 +01:00
Olivier Dony 9a3261da85 [IMP] email_template: allow extra builtins in rendering sandbox
bzr revid: odo@openerp.com-20140310102410-m66aa8164tekr51t
2014-03-10 11:24:10 +01:00
Thibault Delavallée db2bdee343 MERGE] [FIX] email_template: fix relative -> absolute url conversion
Local URLs are converted into absolute URLs, notably because when using the
email designer, images are added using local URLs. Previously to this fix
the template was analyzed to find local URLs and make them absolute.
However this causes 2 issues :
- mako-based URLs are broken because a scheme is added before the mako that
generated the image src
- when changing the base url, the templates are not updated
The URLs are now converted dynamically when generating the content of the
html. This is done by passing a new parameter that enable the post processing
of the generated content.
Also fixed double body generation when using templates; fields parameter
was not propagated correctly.

bzr revid: tde@openerp.com-20140304112957-l9b10gyjqphs5fgc
2014-03-04 12:29:57 +01:00
Thibault Delavallée 05fdc2290a [IMP] email_template: relocate url rewritign stuff directly into the rendering method.
bzr revid: tde@openerp.com-20140303104044-hgmii31ga6msf72z
2014-03-03 11:40:44 +01:00
Thibault Delavallée a9a4767d17 [FIX] email_template :
- fixed composer using template that were rendering the body twice, once form the template and
once from the composer body. Only the latter one is used, so avoid generating the template body
that is not necessary
- fixed email_template generating values for a set of given fields, ignoring the field list
given into parameter
- fixed post processing of templates to transform local urls into absolute urls; now urls are
transformed after body generation, when sending email based on templates , or when generating
the content when using the composer.

bzr revid: tde@openerp.com-20140227153835-gmqnxrzed9fnbxhm
2014-02-27 16:38:35 +01:00
Thibault Delavallée a17c09afff [IMP] [FIX] email_template: do not sanitize the template content.
Indeed its content may contain invalid html that could be stripped by the
sanitizer. The content generated based on the template will be sanitized
when stored in the mail_mail or mail_message body field, thus after
rendering.

bzr revid: tde@openerp.com-20140227144228-d275lxz6ryarkg4t
2014-02-27 15:42:28 +01:00
Thibault Delavallée b1f88d634d [IMP] [FIX] email_template: do not sanitize the template content.
Indeed its content may contain invalid html that could be stripped by the
sanitizer. The content generated based on the template will be sanitized
when stored in the mail_mail or mail_message body field, thus after
rendering.
The template therefore holds html, but that is not sanitized. But that's
still html, therefore using an html field.

bzr revid: tde@openerp.com-20140227134829-te8mxeakc3s96fun
2014-02-27 14:48:29 +01:00
openerp-sle 999050a9df [IMP] Email_template module now handles qweb-pdf report in mail attachment
bzr revid: openerp-sle@openerp-sle.home-20140212212259-sq7mpkt09a0t6v6d
2014-02-12 22:22:59 +01:00
Christophe Simonis c202dc1c52 merge upstream
bzr revid: chs@openerp.com-20140129190834-xfcat3ulfbg5omhn
2014-01-29 20:08:34 +01:00
Christophe Simonis 731019154a [MERGE] forward port of branch saas-2 up to revid 9109 dle@openerp.com-20140129171022-wf6244k90lpncmah
bzr revid: chs@openerp.com-20140129184703-ypd7iqnor5m5lr3d
2014-01-29 19:47:03 +01:00
Frédéric van der Essen 5585a38ecc [MERGE] from trunk, need point_of_sale updates
bzr revid: fva@openerp.com-20140127160946-yeswyv4o7t2tfbqt
2014-01-27 17:09:46 +01:00
Denis Ledoux 1fb1a6f2af [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9789 revid:dle@openerp.com-20140124120102-we2yxio553ws2yz4
bzr revid: dle@openerp.com-20140120174449-tui0a24zgn9bien2
bzr revid: dle@openerp.com-20140121125538-ke7i6kaz486hwgl8
bzr revid: dle@openerp.com-20140122134115-0ogjemlqe327xoac
bzr revid: dle@openerp.com-20140123103655-mf2zslfbgue97ed2
bzr revid: dle@openerp.com-20140124121027-uk9zy4dx9tqlsblr
2014-01-24 13:10:27 +01:00
Thibault Delavallée b845b708af [CLEAN] email_template: cleaned code
bzr revid: tde@openerp.com-20140124114743-m6s8d1byabl78l63
2014-01-24 12:47:43 +01:00
Turkesh Patel (Open ERP) 43ba81ad1b [IMP] use product.template model for templates
bzr revid: tpa@tinyerp.com-20140123134233-vp52fv0e047bbfgk
2014-01-23 19:12:33 +05:30
Martin Trigaux b25d08f917 [FIX] email_template: error message instead of traceback when sending an email from a user without user
bzr revid: mat@openerp.com-20140122094837-a0bkx2huqvkylniy
2014-01-22 10:48:37 +01:00
Thibault Delavallée 9cf78e93cc [MERGE] Sync with trunk, tries to solve conflicts. There are still some new images to convert into images in xml files.
bzr revid: tde@openerp.com-20140116103910-qmm2y6kucmngplnk
2014-01-16 11:39:10 +01:00
Thibault Delavallée 778de23d6f [IMP] email_template: body_html is now an html file, not a text file anymore.
Now that tools.mail.html_sanitize() has been detroyed, there is
no need anymore to keep this field as a text field.

bzr revid: tde@openerp.com-20140113092440-je3vpgohvljukjmn
2014-01-13 10:24:40 +01:00
jke-openerp ecca2f99c3 [Merge] Merge With Trunk
bzr revid: jke@openerp.com-20140106082030-e0auqh3l9b2cpuyi
2014-01-06 09:20:30 +01:00
Denis Ledoux 1508c5dd00 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9718 rev-id: dle@openerp.com-20131224103535-rhtje7dnq1ie7jtb
bzr revid: tde@openerp.com-20131220162158-hbgktly09dv37958
bzr revid: dle@openerp.com-20131223155041-8zp8e08fihbr0ie2
bzr revid: dle@openerp.com-20131224112407-aw6dq2q92312kjbk
2013-12-24 12:24:07 +01:00
Thibault Delavallée b92ad39005 [FIX] email_template: support of email_recipients in send_mail.
email_recipients is a char fields holding a comma separated list of partner_ids
that are the email recipients. This field is correctly handled in the composer
but was not taken into account in the send_mail method email_template.
However due to model limitations, this field can only be taken into account
when sending the email directly using force_send. When the email is
queued, no field is available to hold the value of email_recipients.
This is already fixed in trunk/v8 as a field has been added to handle
this value.

[FIX] mail: when sending email to some recipients_ids, filter to have only
the existing partner_ids. Trusting email template to generate valid
partner_ids is a bit risky.

[TESTS] email_template: added tests for send_mail

bzr revid: tde@openerp.com-20131220144652-h18yam60vpedbh7x
2013-12-20 15:46:52 +01:00
jke-openerp 6bb986a2e5 [FIX] Fix according to APR's Review
- Access Right too restrictif for user
- Bug UI between Firefox and Chrome
- Bug UI many2many_tag cursor on bullet
- Temp Fix on email_template to manage partner_to
- Manage attendee from hr_holidays 
- Manage avatar_model in sidebar_items for filter (res.partner was hard coded)
- Remove quick add from HR-holiday, because some field (as day) is calculated on event "onchange"

bzr revid: jke@openerp.com-20131220141855-mbhxtr07fn0sroe0
2013-12-20 15:18:55 +01:00
jke-openerp 4a1208b39b [IMP] Redo tuto to get api key, because Google have changed console UI during the dev
bzr revid: jke@openerp.com-20131219174536-msjd005fxhxgl9qq
2013-12-19 18:45:36 +01:00
jke-openerp a6a5278747 [FIX] Partner_to changed form template to be a python list and not a list of int separed by comma
bzr revid: jke@openerp.com-20131219152801-e70jmpfw10vf6ruy
2013-12-19 16:28:01 +01:00
jke-openerp 306dd6e397 [IMP] Add span with class for footer received in mail
[FIX] convert partner_to  from template_mail (string with comma) to recipent_ids (list of partner_id) in model mail_mail

bzr revid: jke@openerp.com-20131219133144-zbt100e8030wd927
2013-12-19 14:31:44 +01:00
Thibault Delavallée f2c23488c3 [FIX] email_template: fixing to have the correct report suppose to correctly fix. So, fix the fix to fix it
bzr revid: tde@openerp.com-20131126120843-gt8vdhl3yn61vd8r
2013-11-26 13:08:43 +01:00
Thibault Delavallée 6f322004cc [FIX] email_template: when generating reports
in batch, update the values for all res_ids, not only the
last one of the current template.

bzr revid: tde@openerp.com-20131126110742-aecac7r0zyappo0a
2013-11-26 12:07:42 +01:00
Denis Ledoux f0ee6bac0a [FIX]email_template: render_template_batch return a dict, so we must get the right id of the dict to get the lang
bzr revid: dle@openerp.com-20131118163114-rpmyjik1dkjuipez
2013-11-18 17:31:14 +01:00
Denis Ledoux 4dfe327be5 [FIX]email_template: fixed call to render_template_batch using a list of ids instead of only one id.
bzr revid: dle@openerp.com-20131118150129-log6925i4kc3dkxq
2013-11-18 16:01:29 +01:00
Thibault Delavallée 22822d994b [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130912074055-7wari7rupipuqk17
2013-09-12 09:40:55 +02:00
Christophe Simonis 3fa90321e1 [MERGE] forward port of branch saas-1 up to revid 8772 chs@openerp.com-20130910122113-171osvcukxffxcry
bzr revid: chs@openerp.com-20130910124803-wxkb8gkz1tub5qjf
2013-09-10 14:48:03 +02:00
Thibault Delavallée 9ef46123a6 [IMP] mail.compose.message, email.template: rendering is now done in batch.
Also refactored send_mail in mail.compose.message in order to be able to override
mail values without having to intefere with the send_mail behavior.

bzr revid: tde@openerp.com-20130828140929-xe9hbmbo6jxgs9mh
2013-08-28 16:09:29 +02:00
Olivier Dony 20e5751e62 [IMP] email_template: add `datetime` and `dateutil.relativedelta` in the global rendering context for templates
The `dateutil` package is not included directly in the globals because
`dateutil.relativedelta.relativedelta` is an old-style class and jinja2
does not appear to support instantiating old-style classes within an
expression, so `relativedelta` support is provided using a "lambda proxy".

bzr revid: odo@openerp.com-20130826124405-bixzwyhl65c7v75b
2013-08-26 14:44:05 +02:00
Christophe Simonis aa133b4d29 [MERGE] forward port of branch saas-1 up to revid 8745 chs@openerp.com-20130613181503-82234mo34wxb0oap
bzr revid: chs@openerp.com-20130614091924-z5ta02kwhmwcrgox
2013-06-14 11:19:24 +02:00
Christophe Simonis 448e19e550 [FIX] email_template: correct creation/deletion of context action
bzr revid: chs@openerp.com-20130613143931-tpnx0diyvkovr2xe
2013-06-13 16:39:31 +02:00
Thibault Delavallée b3cde8da4a [FIX] email_template: allow to define context action even without having create access on ir.values and ir.action
Hint: look for backport into 7.0

bzr revid: tde@openerp.com-20130606123415-vuelai2eh1yy3c87
2013-06-06 14:34:15 +02:00
Thibault Delavallée c93c8935ad [IMP] mail: now may raise exception instead of just logging it. They are used in auth_signup to avoid having the process considering the invite/reset password email was sent when it was not.
bzr revid: tde@openerp.com-20130524114857-8wy5uob23i2d6b6p
2013-05-24 13:48:57 +02:00
Olivier Dony 9c08e12962 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9085
revision-id: odo@openerp.com-20130429105458-r89mnkx8okdxsdld

bzr revid: odo@openerp.com-20130429151410-54y94063gijyk16o
2013-04-29 17:14:10 +02:00
chirag patel 27686df49d [FIX] Fixed raise warning when email_from value false.
bzr revid: cpa@tinyerp.com-20130429120409-sm0c01022qm25agv
2013-04-29 17:34:09 +05:30
Thibault Delavallée 856083e2b4 [FIX] email_template: fixed wrong res_id given to attachments in send_mail (should be a mail.message res_id, not a mail.mail res_id), to use the low-level attachments unlink.
bzr revid: tde@openerp.com-20130422102114-a179ylzpgu3g6vcr
2013-04-22 12:21:14 +02:00
Thibault Delavallée 4da68cbc22 [FORWARD] Forward port of addons 7.0 until revision 9008
bzr revid: tde@openerp.com-20130411124446-73gzyw3eo925w3dv
2013-04-11 14:44:46 +02:00
Raphael Collet 96ad608854 [IMP] general: use registry[X] instead registry.get(X) when X is dynamic
bzr revid: rco@openerp.com-20130329143720-80pkd4csemlk1aqz
2013-03-29 15:37:20 +01:00