[FIX] hr_timesheet_invoice avoid empty returns in invoice line description

Closes #5242
This commit is contained in:
Cédric Pigeon 2015-02-12 10:29:20 +01:00 committed by Antony Lesuisse
parent 04de292885
commit cf2b1143dc
1 changed files with 2 additions and 1 deletions

View File

@ -278,7 +278,8 @@ class account_analytic_line(osv.osv):
details.append("%s" % (line['unit_amount'], ))
if data.get('name', False):
details.append(line['name'])
note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
if details:
note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
if note:
curr_line['name'] += "\n" + ("\n".join(map(lambda x: unicode(x) or '',note)))
invoice_line_obj.create(cr, uid, curr_line, context=context)