Add invoice number to report name
authorCédric Krier <ced@b2ck.com>
Mon Jun 22 19:08:54 2009 +0200 (8 months ago)
changeset 35549a8787593d5
parent 354 fd4984b0bac3
child 356 d52d4b0493d3
Add invoice number to report name
CHANGELOG
invoice.py
     1.1 --- a/CHANGELOG	Mon Jun 22 10:47:14 2009 +0200
     1.2 +++ b/CHANGELOG	Mon Jun 22 19:08:54 2009 +0200
     1.3 @@ -1,3 +1,5 @@
     1.4 +* Add invoice number to report name
     1.5 +
     1.6  Version 1.2.0 - 2009-04-20
     1.7  * Bug fixes (see mercurial logs for details)
     1.8  * Add accounting date on invoice
     2.1 --- a/invoice.py	Mon Jun 22 10:47:14 2009 +0200
     2.2 +++ b/invoice.py	Mon Jun 22 19:08:54 2009 +0200
     2.3 @@ -2077,12 +2077,18 @@
     2.4      _name = 'account.invoice'
     2.5  
     2.6      def execute(self, cursor, user, ids, datas, context=None):
     2.7 +        invoice_obj = self.pool.get('account.invoice')
     2.8 +
     2.9          if context is None:
    2.10              context = {}
    2.11          res = super(InvoiceReport, self).execute(cursor, user, ids, datas,
    2.12                  context=context)
    2.13          if len(ids) > 1 or datas['id'] != ids[0]:
    2.14              res = (res[0], res[1], True, res[3])
    2.15 +        else:
    2.16 +            invoice = invoice_obj.browse(cursor, user, ids[0], context=context)
    2.17 +            if invoice.number:
    2.18 +                res = (res[0], res[1], res[2], res[3] + ' - ' + invoice.number)
    2.19          return res
    2.20  
    2.21      def _get_objects(self, cursor, user_id, ids, model, datas, context):