mirror of https://github.com/OCA/web.git
[IMP] do not get the fields when that is not needed
(/home/gbaconnier/code/openerp/c2c-web-addons/lp6.1-main rev 3.1.7)
parent
aa3c03b85c
commit
47a96f6c51
|
@ -141,12 +141,12 @@ def read_translations(self, cr, user, ids, fields=None, context=None, load='_cla
|
||||||
select = map(lambda x: isinstance(x, dict) and x['id'] or x, select)
|
select = map(lambda x: isinstance(x, dict) and x['id'] or x, select)
|
||||||
result = self._read_flat(cr, user, select, fields, context, load)
|
result = self._read_flat(cr, user, select, fields, context, load)
|
||||||
|
|
||||||
|
if context.get('lang') and context['lang'] != 'en_US':
|
||||||
fields_pre = [f for f in fields if
|
fields_pre = [f for f in fields if
|
||||||
(f in self._columns and
|
(f in self._columns and
|
||||||
getattr(self._columns[f], '_classic_write'))] + \
|
getattr(self._columns[f], '_classic_write'))] + \
|
||||||
self._inherits.values()
|
self._inherits.values()
|
||||||
|
|
||||||
if context.get('lang') and context['lang'] != 'en_US':
|
|
||||||
for f in fields_pre:
|
for f in fields_pre:
|
||||||
if self._columns[f].translate:
|
if self._columns[f].translate:
|
||||||
res_ids = [x['id'] for x in result]
|
res_ids = [x['id'] for x in result]
|
||||||
|
|
Loading…
Reference in New Issue