parent
11d1e0c6ce
commit
8822ada31f
|
@ -40,7 +40,7 @@ class ir_model(osv.osv):
|
|||
_rec_name = 'name'
|
||||
_columns = {
|
||||
'name': fields.char('Object Name', size=64, translate=True, required=True),
|
||||
'model': fields.char('Object Name', size=64, required=True, select=1),
|
||||
'model': fields.char('Object', size=64, required=True, select=1),
|
||||
'info': fields.text('Information'),
|
||||
'field_id': fields.one2many('ir.model.fields', 'model_id', 'Fields', required=True),
|
||||
'state': fields.selection([('manual','Custom Object'),('base','Base Object')],'Manualy Created',readonly=True),
|
||||
|
|
|
@ -490,16 +490,13 @@ class module(osv.osv):
|
|||
|
||||
def create(self, cr, uid, data, context={}):
|
||||
id = super(module, self).create(cr, uid, data, context)
|
||||
print 'Create', {
|
||||
'name': 'module_name_translation',
|
||||
'model': 'ir.module.module',
|
||||
'res_id': id,
|
||||
}
|
||||
self.pool.get('ir.model.data').create(cr, uid, {
|
||||
'name': 'module_name_translation',
|
||||
'model': 'ir.module.module',
|
||||
'res_id': id,
|
||||
})
|
||||
if data.get('name'):
|
||||
self.pool.get('ir.model.data').create(cr, uid, {
|
||||
'name': 'module_name_translation',
|
||||
'model': 'ir.module.module',
|
||||
'res_id': id,
|
||||
'module': data['name']
|
||||
})
|
||||
return id
|
||||
module()
|
||||
|
||||
|
|
|
@ -1382,8 +1382,15 @@ class orm(orm_template):
|
|||
for id in childs:
|
||||
pos2 = browse_rec(id[0], pos2)
|
||||
cr.execute('update '+self._table+' set parent_left=%s, parent_right=%s where id=%s', (pos,pos2,root))
|
||||
print 'Updating', self._table, pos,pos2,root
|
||||
return pos2+1
|
||||
browse_rec(None)
|
||||
query = 'SELECT id FROM '+self._table+' WHERE '+self._parent_name+' IS NULL'
|
||||
if self._parent_order:
|
||||
query += ' order by '+self._parent_order
|
||||
pos = 0
|
||||
cr.execute(query)
|
||||
for (root,) in cr.fetchall():
|
||||
pos = browse_rec(root, pos)
|
||||
return True
|
||||
|
||||
def _update_store(self, cr, f, k):
|
||||
|
|
|
@ -358,32 +358,6 @@ class rml_parse(object):
|
|||
date = mx.DateTime.DateTime(*(value.timetuple()[:6]))
|
||||
return date.strftime(date_format)
|
||||
return lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
|
||||
|
||||
# def formatLang(self, value, digit=2, date=False):
|
||||
# if not value:
|
||||
# return ''
|
||||
# lc, encoding = locale.getdefaultlocale()
|
||||
# if not encoding:
|
||||
# encoding = 'UTF-8'
|
||||
# if encoding == 'utf':
|
||||
# encoding = 'UTF-8'
|
||||
# if encoding == 'cp1252':
|
||||
# encoding= '1252'
|
||||
# lang = self.localcontext.get('lang', 'en_US') or 'en_US'
|
||||
# try:
|
||||
# if os.name == 'nt':
|
||||
# locale.setlocale(locale.LC_ALL, _LOCALE2WIN32.get(lang, lang) + '.' + encoding)
|
||||
# else:
|
||||
# locale.setlocale(locale.LC_ALL, lang + '.' + encoding)
|
||||
# except Exception:
|
||||
# netsvc.Logger().notifyChannel('report', netsvc.LOG_WARNING,
|
||||
# 'report %s: unable to set locale "%s"' % (self.name,
|
||||
# self.localcontext.get('lang', 'en_US') or 'en_US'))
|
||||
# if date:
|
||||
# date = time.strptime(value, DT_FORMAT)
|
||||
# return time.strftime(locale.nl_langinfo(locale.D_FMT).replace('%y', '%Y'),
|
||||
# date)
|
||||
# return locale.format('%.' + str(digit) + 'f', value, True)
|
||||
|
||||
def repeatIn(self, lst, name, nodes_parent=False):
|
||||
self._node.data = ''
|
||||
|
|
Loading…
Reference in New Issue