[MERGE] Account: name_get method on invoice updated=> if there is a number: use it...
authorMustufa Rangwala <mra@mra-laptop>
Wed, 10 Nov 2010 12:13:05 +0000 (17:43 +0530)
committerMustufa Rangwala <mra@mra-laptop>
Wed, 10 Nov 2010 12:13:05 +0000 (17:43 +0530)
bzr revid: mra@mra-laptop-20101110121305-emszew8zt6k3s5sk

1  2 
addons/account/invoice.py

@@@ -1063,7 -1063,7 +1063,7 @@@ class account_invoice(osv.osv)
                  'out_refund': 'OR: ',
                  'in_refund': 'SR: ',
                  }
-         return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
 -        return [(r['id'], (r['number']) or types[r['type']]+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
++        return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
  
      def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
          if not args:
              context = {}
          ids = []
          if name:
--            ids = self.search(cr, user, [('number','=',name)]+ args, limit=limit, context=context)
++            ids = self.search(cr, user, [('number','=',name)] + args, limit=limit, context=context)
          if not ids:
--            ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
++            ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context)
          return self.name_get(cr, user, ids, context)
  
      def _refund_cleanup_lines(self, cr, uid, lines):