From c74e937b0d9e0cc2a879c3ba712de3c74f0931d4 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 29 Oct 2012 10:29:01 +0100 Subject: [PATCH] Adjusted email template bzr revid: jco@openerp.com-20121029092901-gc8y4d1o04ijexkb --- addons/account_followup/account_followup.py | 20 +++-- .../account_followup_data.xml | 88 ++----------------- 2 files changed, 18 insertions(+), 90 deletions(-) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 14362eca733..2fdc1e3969a 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -197,7 +197,9 @@ class res_partner(osv.osv): def do_partner_phonecall(self, cr, uid, partner_ids, context=None): #partners = self.browse(cr, uid, partner_ids, context) #print partner_ids - self.write(cr, uid, partner_ids, {'payment_next_date': fields.date.context_today(cr, uid, context), 'payment_next_action':'Phony'}, context) + print "Testing: " , fields.date.context_today(cr, uid, context) + self.write(cr, uid, partner_ids, {'payment_next_action_date': fields.date.context_today(cr, uid, context), 'payment_next_action' : 'Phoning'}, context) + @@ -223,18 +225,18 @@ class res_partner(osv.osv): mail_template_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_followup', 'email_template_account_followup') mtp = self.pool.get('email.template') #mtp.subject = "Invoices overdue" - #user_obj = self.pool.get('res.users') - #mtp.email_from = user_obj.browse(cr, uid, uid, context=context) for partner in self.browse(cr, uid, partner_ids, context): - pass + #Get max level of ids -# if partner.latest_followup_level_id.email_template_id != False: -# mtp.send_mail(cr, uid, partner.id, partner.latest_followup_level_id.email_template_id.id, context=context) -# else: -# mtp.send_mail(cr, uid, partner.id, mail_template_id.id, context=context) - + if partner.latest_followup_level_id.email_template_id != False: + #print "From latest followup level", partner.latest_followup_level_id.email_template_id.id + mtp.send_mail(cr, uid, partner.latest_followup_level_id.email_template_id.id, partner.id, context=context) + else: + #print "From mail template", mail_template_id.id + mtp.send_mail(cr, uid, mail_template_id.id, partner.id, context=context) + #complete the mail body with partner information #(to be discussed with fp) attach the report to the mail or include the move lines in the mail body #send the mail (need to check the function name) diff --git a/addons/account_followup/account_followup_data.xml b/addons/account_followup/account_followup_data.xml index 05df2b9a179..85a8f493189 100644 --- a/addons/account_followup/account_followup_data.xml +++ b/addons/account_followup/account_followup_data.xml @@ -6,7 +6,7 @@ - + Followup of outstanding accounts ${object.user_id.email or ''} ${object.company_id.name} Followup ${object.email} @@ -16,94 +16,20 @@ ${object.latest_followup_level_id.description} -

Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},

+

Hello${object.name and ' ' or ''},

-

Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}:

+

We see in our books that some accounts are not settled yet:

+ + <%for aml in ${object.accountmoveline_ids}> + ${aml.debit} + <%endfor>

  REFERENCES
  Order number: ${object.name}
-   Order total: ${object.amount_total} ${object.pricelist_id.currency_id.name}
-   Order date: ${object.date_order}
- % if object.origin: -   Order reference: ${object.origin}
- % endif - % if object.client_order_ref: -   Your reference: ${object.client_order_ref}
- % endif   Your contact: ${object.user_id.name}

- -

- Testing -


- - - - - -

- You can view the ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} document, download it and pay online using the following link: -

- View Order - - % if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account and object.state not in ('draft', 'sent'): - <% - comp_name = quote(object.company_id.name) - order_name = quote(object.name) - paypal_account = quote(object.company_id.paypal_account) - order_amount = quote(str(object.amount_total)) - cur_name = quote(object.pricelist_id.currency_id.name) - paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=%s&item_name=%s%%20Order%%20%s" \ - "&invoice=%s&amount=%s&currency_code=%s&button_subtype=services&no_note=1" \ - "&bn=OpenERP_Order_PayNow_%s" % \ - (paypal_account,comp_name,order_name,order_name,order_amount,cur_name,cur_name) - %> -
-

It is also possible to directly pay with Paypal:

- - - - % endif - -
-

If you have any question, do not hesitate to contact us.

-

Thank you for choosing ${object.company_id.name or 'us'}!

-
-
-
-

- ${object.company_id.name}

-
-
- - % if object.company_id.street: - ${object.company_id.street}
- % endif - % if object.company_id.street2: - ${object.company_id.street2}
- % endif - % if object.company_id.city or object.company_id.zip: - ${object.company_id.zip} ${object.company_id.city}
- % endif - % if object.company_id.country_id: - ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
- % endif -
- % if object.company_id.phone: -
- Phone:  ${object.company_id.phone} -
- % endif - % if object.company_id.website: -
- Web : ${object.company_id.website} -
- %endif -

-
]]>