on module model, made new function for install module with dependency.
bzr revid: hmo@tinyerp.com-20080826104113-pnnxx93osl7hr6d1
This commit is contained in:
parent
4d9214cff5
commit
d8d9b8fc86
|
@ -516,6 +516,15 @@ class module(osv.osv):
|
|||
p_id = c_id
|
||||
categs = categs[1:]
|
||||
self.write(cr, uid, [id], {'category_id': p_id})
|
||||
|
||||
def action_install(self,cr,uid,ids,context=None):
|
||||
self.write(cr , uid, ids ,{'state' : 'to install'})
|
||||
self.download(cr, uid, ids, context=context)
|
||||
for id in ids:
|
||||
cr.execute("select m.id as id from ir_module_module_dependency d inner join ir_module_module m on (m.name=d.name) where d.module_id=%d and m.state='uninstalled'",(id,))
|
||||
dep_ids = map(lambda x:x[0],cr.fetchall())
|
||||
if len(dep_ids):
|
||||
self.action_install(cr,uid,dep_ids,context=context)
|
||||
module()
|
||||
|
||||
class module_dependency(osv.osv):
|
||||
|
|
|
@ -1119,9 +1119,11 @@ class orm_memory(orm_template):
|
|||
for id in ids:
|
||||
r = {'id': id}
|
||||
for f in fields:
|
||||
r[f] = self.datas[id].get(f, False)
|
||||
if id in self.datas:
|
||||
r[f] = self.datas[id].get(f, False)
|
||||
result.append(r)
|
||||
self.datas[id]['internal.date_access'] = time.time()
|
||||
if id in self.datas:
|
||||
self.datas[id]['internal.date_access'] = time.time()
|
||||
fields_post = filter(lambda x: x in self._columns and not getattr(self._columns[x], load), fields)
|
||||
for f in fields_post:
|
||||
res2 = self._columns[f].get_memory(cr, self, ids, f, user, context=context, values=False)
|
||||
|
|
Loading…
Reference in New Issue