diff --git a/CHANGELOG b/CHANGELOG index 26f0840a7b..25e1a26576 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Add invoice number to report name + Version 1.2.0 - 2009-04-20 * Bug fixes (see mercurial logs for details) * Add accounting date on invoice diff --git a/invoice.py b/invoice.py index 27351ebeba..4a0567cd4b 100644 --- a/invoice.py +++ b/invoice.py @@ -2077,12 +2077,18 @@ class InvoiceReport(Report): _name = 'account.invoice' def execute(self, cursor, user, ids, datas, context=None): + invoice_obj = self.pool.get('account.invoice') + if context is None: context = {} res = super(InvoiceReport, self).execute(cursor, user, ids, datas, context=context) if len(ids) > 1 or datas['id'] != ids[0]: res = (res[0], res[1], True, res[3]) + else: + invoice = invoice_obj.browse(cursor, user, ids[0], context=context) + if invoice.number: + res = (res[0], res[1], res[2], res[3] + ' - ' + invoice.number) return res def _get_objects(self, cursor, user_id, ids, model, datas, context):