Ravi Gohil (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-576879-rgo into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576879-rgo/+merge/116590

Hello,

This branch contains fix for below issues of account_followup module:

1) If we haven't configured smtp's '--email_from' parameter and sends email 
using 'Send followups' wizard, the email created in queue will not have any 
value for 'From', so the e-mail wont be sent. After adding an sender e-mail 
address the e-mail gets send,
2) The message appears when you try to send email without option 'Send email 
confirmation' ticket, is not translated,
3) The e-mail subject in wizard is not translated,
4) When printing the followup report from wizard, address is not being 
translated in partner language,

Kindly review the fix.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576879-rgo/+merge/116590
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-576879-rgo.
=== modified file 'account_followup/i18n/account_followup.pot'
--- account_followup/i18n/account_followup.pot	2012-02-08 01:08:30 +0000
+++ account_followup/i18n/account_followup.pot	2012-07-25 06:58:21 +0000
@@ -332,6 +332,21 @@
 msgstr ""
 
 #. module: account_followup
+#: code:addons/account_followup/wizard/account_followup_print.py:229
+#, python-format
+msgid "E-Mail not available for user: %s"
+msgstr ""
+
+#. module: account_followup
+#: code:addons/account_followup/wizard/account_followup_print.py:301
+#, python-format
+msgid "\n"
+"\n"
+"\n"
+"E-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard."
+msgstr ""
+
+#. module: account_followup
 #: help:account.followup.print,date:0
 msgid "This field allow you to select a forecast date to plan your follow-ups"
 msgstr ""

=== modified file 'account_followup/report/account_followup_print.py'
--- account_followup/report/account_followup_print.py	2011-12-19 16:54:40 +0000
+++ account_followup/report/account_followup_print.py	2012-07-25 06:58:21 +0000
@@ -34,6 +34,7 @@
             'getLines': self._lines_get,
             'get_text': self._get_text
         })
+        self.context = context
 
     def _ids_to_objects(self, ids):
         pool = pooler.get_pool(self.cr.dbname)
@@ -47,7 +48,7 @@
         res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
         res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
         adr = res_partner.address_get(self.cr, self.uid, [stat_line.partner_id.id], [type])[type]
-        return adr and res_partner_address.read(self.cr, self.uid, [adr]) or [{}]
+        return adr and res_partner_address.read(self.cr, self.uid, [adr], context=self.context.copy()) or [{}]
 
     def _lines_get(self, stat_by_partner_line):
         pool = pooler.get_pool(self.cr.dbname)

=== modified file 'account_followup/wizard/account_followup_print.py'
--- account_followup/wizard/account_followup_print.py	2012-02-13 16:03:19 +0000
+++ account_followup/wizard/account_followup_print.py	2012-07-25 06:58:21 +0000
@@ -141,7 +141,7 @@
 
     _defaults = {
          'email_body': _get_msg,
-         'email_subject': _('Invoices Reminder'),
+         'email_subject': lambda self, cr, uid, context: _('Invoices Reminder'),
          'partner_lang': True,
          'partner_ids': _get_partners,
          'summary': _get_summary,
@@ -223,10 +223,13 @@
         partners = [stat_by_partner_line / 10000 for stat_by_partner_line in stat_by_partner_line_ids]
         model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all_msg')], context=context)
         resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
-        if data.email_conf:
+        data_user = user_obj.browse(cr, uid, uid, context=context)
+        src = tools.config.options['email_from'] or data_user.user_email
+        if not src:
+            context.update({'summary': _("E-Mail not available for user: %s") % data_user.name})
+        elif data.email_conf:
             msg_sent = ''
             msg_unsent = ''
-            data_user = user_obj.browse(cr, uid, uid, context=context)
             for partner in self.pool.get('res.partner').browse(cr, uid, partners, context=context):
                 ids_lines = move_obj.search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable']),('company_id','=',context.get('company_id', False))])
                 data_lines = move_obj.browse(cr, uid, ids_lines, context=context)
@@ -242,7 +245,6 @@
                         if (not dest) and adr.type=='default':
                             if adr.email:
                                 dest = [adr.email]
-                src = tools.config.options['email_from']
                 if not data.partner_lang:
                     body = data.email_body
                 else:
@@ -298,7 +300,7 @@
                 summary = msg_unsent + line + msg_sent
             context.update({'summary': summary})
         else:
-            context.update({'summary': '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'})
+            context.update({'summary': _("\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.")})
 
         return {
             'name': _('Followup Summary'),

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to