bzr revid: fp@tinyerp.com-20090411204439-ivly6x341y9pwuzs
This commit is contained in:
Fabien Pinckaers
2009-04-11 22:44:39 +02:00
parent 55166bd746
commit 5ba9c8626f
3 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -518,7 +518,7 @@ class actions_server(osv.osv):
result = self.pool.get(action.action_id.type).read(cr, uid, action.action_id.id, context=context)
return result
if action.state=='python':
if action.state=='code':
localdict = {
'self': self.pool.get(action.model_id.model),
'context': context,
+1 -3
View File
@@ -181,14 +181,12 @@ class browse_record(object):
fffields = map(lambda x: x[0], ffields)
datas = self._table.read(self._cr, self._uid, ids, fffields, context=self._context, load="_classic_write")
if self._fields_process:
lang = self._context.get('lang', 'en_US') or 'en_US'
lang_obj = self.pool.get('res.lang').browse(self._cr, self._uid,self.pool.get('res.lang').search(self._cr, self._uid,[('code','=',lang)])[0])
for n, f in ffields:
if f._type in self._fields_process:
for d in datas:
d[n] = self._fields_process[f._type](d[n])
if d[n]:
d[n].set_value(self._cr, self._uid, d[n], self, f, lang_obj)
d[n].set_value(self._cr, self._uid, d[n], self, f)
# create browse records for 'remote' objects
+8 -2
View File
@@ -65,12 +65,18 @@ rml2sxw = {
}
class _format(object):
def set_value(self, cr, uid, name, object, field, lang_obj):
def set_value(self, cr, uid, name, object, field):
#super(_date_format, self).__init__(self)
pool_lang = pooler.get_pool(cr.dbname).get('res.lang')
self.object = object
self._field = field
self.name = name
self.lang_obj = lang_obj
lang = self.object._context.get('lang', 'en_US') or 'en_US'
lids = pool_lang.search(cr, uid,[('code','=',lang)])
if lids:
self.lang_obj = pool_lang.browse(cr, uid,lids[0])
else:
self.lang_obj = False
class _float_format(float, _format):