Merge lp:~openerp-dev/openobject-addons/6.1-opw-578237-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-578237-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 31 lines (+4/-3)
1 file modified
account_followup/report/account_followup_print.py (+4/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-578237-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+120342@code.launchpad.net

Description of the change

Hello,

Generated pdf does not translate the address in partner language and "Description" and "Ref" column's values in pdf are incorrect.

This fix fixes these issues. Kindly review the fix.

Thanks.

To post a comment you must log in.

Unmerged revisions

6953. By Ravi Gohil (OpenERP)

[FIX] account_followup: address on pdf generated is not translated and wrong values in description and invoice columns of pdf: (Maintenance Case : 578237)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_followup/report/account_followup_print.py'
2--- account_followup/report/account_followup_print.py 2011-12-19 16:54:40 +0000
3+++ account_followup/report/account_followup_print.py 2012-08-20 07:36:25 +0000
4@@ -34,6 +34,7 @@
5 'getLines': self._lines_get,
6 'get_text': self._get_text
7 })
8+ self.context = context
9
10 def _ids_to_objects(self, ids):
11 pool = pooler.get_pool(self.cr.dbname)
12@@ -47,7 +48,7 @@
13 res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
14 res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
15 adr = res_partner.address_get(self.cr, self.uid, [stat_line.partner_id.id], [type])[type]
16- return adr and res_partner_address.read(self.cr, self.uid, [adr]) or [{}]
17+ return adr and res_partner_address.read(self.cr, self.uid, [adr], context=self.context.copy()) or [{}]
18
19 def _lines_get(self, stat_by_partner_line):
20 pool = pooler.get_pool(self.cr.dbname)
21@@ -68,8 +69,8 @@
22 line_cur[line.currency_id.id] = {'line': []}
23 currency = line.currency_id or line.company_id.currency_id
24 line_data = {
25- 'name': line.move_id.name,
26- 'ref': line.ref,
27+ 'name': line.invoice.name,
28+ 'ref': line.invoice.number,
29 'date':line.date,
30 'date_maturity': line.date_maturity,
31 'balance': currency.id <> line.company_id.currency_id.id and line.amount_currency or (line.debit - line.credit),