Merge lp:~openerp-dev/openobject-addons/6.1-opw-578235-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-578235-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 66 lines (+29/-2)
2 files modified
account_followup/i18n/account_followup.pot (+6/-0)
account_followup/wizard/account_followup_print.py (+23/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-578235-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+120331@code.launchpad.net

Description of the change

Hello,

Reminding mail sent to partners for account followup do not have .pdf in as attachment, This MP contains fix for this issue. Kindly review the fix.

Thanks.

To post a comment you must log in.
6953. By Quentin (OpenERP) <email address hidden>

[FIX] account_voucher: supplier payment, accounting entry generation

6954. By Xavier ALT

[MERGE] OPW 576484: account: fix invoice residual, avoid adding multiple times residual for same partial reconcile

6955. By Xavier ALT

[MERGE] OPW 577014: email_template: for not force mass_mail in mail.compose.message wizard, if user is working on a single resource

6956. By Xavier ALT

[MERGE] OPW 576491: edi + email_template: correctly generate edi_web_view_url when sending email from mail.compose.message wizard

 * edi: improve generation/usage of edi_web_url_view for template rendering

   - wrap edi_web_url_view generation to _edi_get_object_web_url_view() method.
   - automatically add 'edi_web_url_view' to all email.template rendering context

   - introduce LazyEdiWebUrlViewGetter class, to allow resolving record wihtin
     template rendering context - only when necessary. This to prevent generating
     unrequested edi_web_url_view links

 * mail & email_template: allow to modify render_template context

   - add _prepare_render_template_context() method to allow modifying context
     before rendering template.

6957. By Quentin (OpenERP) <email address hidden>

[MERGE] fixes in account_voucher

6958. By Xavier ALT

[FIX] OPW 577963: ir_attachment: speed up ir.attachment search for large databases

6959. By Olivier Dony (Odoo)

[FIX] document: complete previous fix, restore sort order after filtering

6960. By Xavier ALT

[MERGE] BUG 1039664: edi: fix wrong cursor when generating edi_web_url_view

  regression from revid: <email address hidden>

6961. By Xavier ALT

[MERGE] OPW 577140: stock: use float_compare() to check if initial and provided quantity equals - based on UoM rounding

6962. By Olivier Dony (Odoo)

[MERGE] OPW 576610: always reuse printed invoice instead of regenerating

Backport of trunk fix r.7215
revid:<email address hidden>

6963. By Xavier ALT

[MERGE] OPW 267641: crm/crm_action_rule: mail action are not sent to both action and current watchers

6964. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

6965. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch with fixes

6966. By Xavier ALT

[MERGE] OPW 574251: account_voucher: voucher on bank statement, have to use period and date from bank statement / bank statement line - not today

6967. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

6968. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

6969. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

6970. By Ravi Gohil (OpenERP)

[FIX] account_followup: mail sent using followup wizard do not have pdf attached: (Maintenance Case : 578235)

Unmerged revisions

6970. By Ravi Gohil (OpenERP)

[FIX] account_followup: mail sent using followup wizard do not have pdf attached: (Maintenance Case : 578235)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_followup/i18n/account_followup.pot'
2--- account_followup/i18n/account_followup.pot 2012-02-08 01:08:30 +0000
3+++ account_followup/i18n/account_followup.pot 2012-08-31 13:04:28 +0000
4@@ -332,6 +332,12 @@
5 msgstr ""
6
7 #. module: account_followup
8+#: code:addons/account_followup/wizard/account_followup_print.py:303
9+#, python-format
10+msgid "Followup-"
11+msgstr ""
12+
13+#. module: account_followup
14 #: help:account.followup.print,date:0
15 msgid "This field allow you to select a forecast date to plan your follow-ups"
16 msgstr ""
17
18=== modified file 'account_followup/wizard/account_followup_print.py'
19--- account_followup/wizard/account_followup_print.py 2012-02-13 16:03:19 +0000
20+++ account_followup/wizard/account_followup_print.py 2012-08-31 13:04:28 +0000
21@@ -25,6 +25,8 @@
22 import tools
23 from osv import fields, osv
24 from tools.translate import _
25+import base64
26+import netsvc
27
28 class account_followup_print(osv.osv_memory):
29 _name = 'account.followup.print'
30@@ -227,7 +229,16 @@
31 msg_sent = ''
32 msg_unsent = ''
33 data_user = user_obj.browse(cr, uid, uid, context=context)
34- for partner in self.pool.get('res.partner').browse(cr, uid, partners, context=context):
35+ line_ids = line_obj.search(cr,uid,[('partner_id', 'in', partners)])
36+ partners = []
37+ dict_lines = {}
38+ for line in line_obj.browse(cr, uid, line_ids, context=context):
39+ if line.partner_id.id not in dict_lines.keys():
40+ partners.append(line.partner_id)
41+ dict_lines[line.partner_id.id] = [line]
42+ else:
43+ dict_lines[line.partner_id.id].append(line)
44+ for partner in partners:
45 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))])
46 data_lines = move_obj.browse(cr, uid, ids_lines, context=context)
47 total_amt = 0.0
48@@ -282,7 +293,17 @@
49 msg = ''
50 if dest:
51 try:
52- mail_message.schedule_with_attach(cr, uid, src, dest, sub, body, context=context)
53+ company_id = context.get('company_id')
54+ data_dict = {'form':{'partner_ids':[partner.id * 10000 + company_id], 'date': time.strftime('%Y-%m-%d'), 'followup_id': context.get('followup_id')}}
55+ ctx = context.copy()
56+ ctx['lang'] = partner.lang or ctx.get('lang')
57+ datax,frmt = netsvc.LocalService('report.account_followup.followup.print').create(cr, uid, [], data_dict, ctx)
58+ params = {
59+ 'datas': base64.encodestring( datax ),
60+ 'datas_fname': _('Followup-') + str(partner.name) + '.' + frmt,
61+ }
62+ attach = dict(map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), [params]))
63+ mail_message.schedule_with_attach(cr, uid, src, dest, sub, body, attachments=attach, context=context)
64 msg_sent += partner.name + '\n'
65 except Exception, e:
66 raise osv.except_osv('Error !', e )