[MERGE] forward port of branch 7.0 up to 6d4e1cc
This commit is contained in:
commit
76fdbec3bb
|
@ -338,12 +338,12 @@ class account_move_line(osv.osv):
|
|||
for line_id, invoice_id in cursor.fetchall():
|
||||
res[line_id] = invoice_id
|
||||
invoice_ids.append(invoice_id)
|
||||
invoice_names = {False: ''}
|
||||
invoice_names = {}
|
||||
for invoice_id, name in invoice_obj.name_get(cursor, user, invoice_ids, context=context):
|
||||
invoice_names[invoice_id] = name
|
||||
for line_id in res.keys():
|
||||
invoice_id = res[line_id]
|
||||
res[line_id] = (invoice_id, invoice_names[invoice_id])
|
||||
res[line_id] = invoice_id and (invoice_id, invoice_names[invoice_id]) or False
|
||||
return res
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
##############################################################################
|
||||
|
||||
import logging
|
||||
import unicodedata
|
||||
|
||||
from openerp import tools
|
||||
import openerp.modules
|
||||
|
@ -332,10 +333,11 @@ class ir_translation(osv.osv):
|
|||
AND name=%s""",
|
||||
(lang or '', types, tools.ustr(name)))
|
||||
res = cr.fetchone()
|
||||
trad = res and res[0] or u''
|
||||
trad = res and tools.ustr(res[0]) or u''
|
||||
if source and not trad:
|
||||
return tools.ustr(source)
|
||||
return trad
|
||||
# Remove control characters
|
||||
return filter(lambda c: unicodedata.category(c) != 'Cc', trad)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if context is None:
|
||||
|
|
Loading…
Reference in New Issue