[MERGE] Account: name_get method on invoice updated=> if there is a number: use it as name, if not use current name_get, with CI: invoice.name, and if empty it will be CI alone

bzr revid: mra@mra-laptop-20101110121305-emszew8zt6k3s5sk
This commit is contained in:
Mustufa Rangwala 2010-11-10 17:43:05 +05:30
commit 70085315c0
1 changed files with 3 additions and 3 deletions

View File

@ -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')]
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if not args:
@ -1072,9 +1072,9 @@ class account_invoice(osv.osv):
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):