[FIX] account_followup: avoid crashing when a move line has no ref
authorOlivier Dony <odo@openerp.com>
Wed, 13 Aug 2014 09:45:59 +0000 (11:45 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 13 Aug 2014 09:45:59 +0000 (11:45 +0200)
addons/account_followup/account_followup.py

index 0e3cd0a..f05d6fc 100644 (file)
@@ -273,7 +273,7 @@ class res_partner(osv.osv):
                     if date <= current_date and aml['balance'] > 0:
                         strbegin = "<TD><B>"
                         strend = "</B></TD>"
-                    followup_table +="<TR>" + strbegin + str(aml['date']) + strend + strbegin + aml['name'] + strend + strbegin + aml['ref'] + strend + strbegin + str(date) + strend + strbegin + str(aml['balance']) + strend + strbegin + block + strend + "</TR>"
+                    followup_table +="<TR>" + strbegin + str(aml['date']) + strend + strbegin + aml['name'] + strend + strbegin + (aml['ref'] or '') + strend + strbegin + str(date) + strend + strbegin + str(aml['balance']) + strend + strbegin + block + strend + "</TR>"
                 total = rml_parse.formatLang(total, dp='Account', currency_obj=currency)
                 followup_table += '''<tr> </tr>
                                 </table>