From 73dd7ccacca6628b4802ea0862494d33bc9713cd Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 6 Dec 2012 17:47:06 +0100 Subject: [PATCH] [FIX] fixed emails in multi currency + removed duplicated code bzr revid: qdp-launchpad@openerp.com-20121206164706-o25nomraucn6pcxd --- addons/account_followup/account_followup.py | 6 ++-- .../report/account_followup_print.py | 36 ------------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 3f89ac09502..29197550841 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -131,7 +131,7 @@ class email_template(osv.osv): final_res = rml_parse._lines_get_with_partner(partner, company.id) for currency_dict in final_res: - currency_symbol = currency_dict.get('line', [{'currency_id': company.currency_id}])[0]['currency_id'].symbol + currency = currency_dict.get('line', [{'currency_id': company.currency_id}])[0]['currency_id'] followup_table += ''' @@ -141,7 +141,7 @@ class email_template(osv.osv): - ''' % (currency_symbol) + ''' % (currency.symbol) total = 0 for aml in currency_dict['line']: block = aml['blocked'] and 'X' or ' ' @@ -153,7 +153,7 @@ class email_template(osv.osv): strbegin = "" followup_table +="" + strbegin + str(aml['date']) + strend + strbegin + aml['ref'] + strend + strbegin + str(date) + strend + strbegin + str(aml['balance']) + strend + strbegin + block + strend + "" - total = rml_parse.formatLang(total, dp='Account', currency_obj=partner.company_id.currency_id) + total = rml_parse.formatLang(total, dp='Account', currency_obj=currency) followup_table += '''
Amount (%s) Lit.
" strend = "
Amount due: %s
''' % (total) diff --git a/addons/account_followup/report/account_followup_print.py b/addons/account_followup/report/account_followup_print.py index 65a56957d07..bf346167182 100644 --- a/addons/account_followup/report/account_followup_print.py +++ b/addons/account_followup/report/account_followup_print.py @@ -81,42 +81,6 @@ class report_rappel(report_sxw.rml_parse): final_res.append({'line': line_cur[cur]['line']}) return final_res - def get_unreconciled_table(self, partner, company, context = None): - final_res = self._lines_get_with_partner(partner, company.id) - followup_table = '' - for currency_dict in final_res: - currency = currency_dict.get('line', [{'currency_id': company.currency_id}])[0]['currency_id'] - followup_table += ''' - - - - - - - - - ''' % (currency.symbol) - total = 0 - ctx = context - for aml in currency_dict['line']: - block = aml['blocked'] and 'X' or ' ' - total += aml['balance'] - strbegin = "" - date = aml['date_maturity'] or aml['date'] - if date <= ctx['current_date'] and aml['balance'] > 0: - strbegin = "" - followup_table +="" + strbegin + str(aml['date']) + strend + strbegin + \ - aml['ref'] + strend + strbegin + str(date) + strend + strbegin + \ - str(aml['balance']) + strend + strbegin + block + strend + "" - total = self.formatLang(total, dp='Account', currency_obj=currency) - followup_table += ''' -
Invoice dateReferenceDue dateAmount (%s)Lit.
" - strend = "" - strend = "
-
Amount due: %s
''' % (total) - return followup_table - - def _get_text(self, stat_line, followup_id, context=None): if context is None: context = {}