From 77ce35eb792d4cefe31339c4065f0d77980bb5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 Apr 2009 13:49:28 +0200 Subject: [PATCH] Add reference in rec_name of invoice --- invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index ac72f275ac..4557ead7cd 100644 --- a/invoice.py +++ b/invoice.py @@ -875,6 +875,7 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): res = {} for invoice in self.browse(cursor, user, ids, context=context): res[invoice.id] = invoice.number or unicode(invoice.id) + \ + (invoice.reference and (' ' + invoice.reference) or '') + \ ' ' + invoice.party.rec_name return res @@ -882,8 +883,9 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): args2 = [] i = 0 while i < len(args): - ids = self.search(cursor, user, [ + ids = self.search(cursor, user, ['OR', ('number', args[i][1], args[i][2]), + ('reference', args[i][1], args[i][2]), ], limit=1, context=context) if ids: args2.append(('number', args[i][1], args[i][2]))