On Friday, May 30, 2014 9:23:13 AM UTC-5, Cédric Krier wrote:
>
> On 30 May 06:47, Paul Leverett wrote:
> > I have configured the email fields to in Reports things like this:
> > {'to': '[email protected] <javascript:>', 'cc': 'subject': 'Quotation
> / Confirmation of
> > Order'}
> > (example for Sale)
> >
> > This works OK with static text, but is not very useful as the text needs
> to
> > be dynamic and related to the Report.
> > What I would like to achieve is:
> > To: email address of Contact on the Party for this Sale
> > Subject: Reference of Sale, Description of Sale
> >
> > I have seen mention of this and that "You have to use a PYSON
> statement",
> > but I do not know how to do this.
> > Could someone please give an example? It would be really useful to me if
> I
> > could see an example of how this works, I am sure someone must have done
> it
> > before.
>
Based in the help that Cédric kindly gave me in the topic [1], I'm going to
summarize the
steps needed to setup in Trtyon client for sending the Report by email.
In Tryton client do this:
- Into "Options>Email>Command line:" set this [2]
- Into "Administration>User Interface>Actions>Reports" set this [3]. Here
is
needed to set for each report.
It is needed to create a module that extend the Sale module. This new
module
must have a new function field for example 'party_email' in where is stored
the
value we want into 'To' field of Email Client.
If I'm wrong in any of the steps, please correct me.
[1] https://groups.google.com/forum/#!topic/tryton/Wz73JjGq8VY
[2] thunderbird -compose "to='${to}',cc='${cc}',
subject='${subject}',body='${body}''"
[3] {'to': Eval('party_email'), 'cc': '[email protected]', 'subject':
Eval('confirmation_order')}
> It will be:
>
> {'to': Eval('<field name>'), …}
>
> <field name> must be the name of the field on Sale that will contains
> the email and it must be added to the view from which the report is
> called.
>
> --
> Cédric Krier - B2CK SPRL
> Email/Jabber: [email protected] <javascript:>
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/
>