diff --git a/bin/addons/base/base.sql b/bin/addons/base/base.sql index 05696f4dc56..14a9ad2bf4f 100644 --- a/bin/addons/base/base.sql +++ b/bin/addons/base/base.sql @@ -2,13 +2,6 @@ -- Pure SQL ------------------------------------------------------------------------- -CREATE TABLE inherit ( - obj_type varchar(128) not null, - obj_id int not null, - inst_type varchar(128) not null, - inst_id int not null -); - ------------------------------------------------------------------------- -- IR dictionary ------------------------------------------------------------------------- @@ -336,3 +329,4 @@ CREATE TABLE ir_model_data ( res_id integer, primary key(id) ); +INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), 'base', 'ir.model', %s) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 0bf3fb22cab..1f0f2c096bf 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1839,10 +1839,6 @@ class orm(orm_template): _('You try to bypass an access rule (Document type: %s).') % \ self._description) - cr.execute('delete from inherit ' \ - 'where (obj_type=%s and obj_id in ('+str_d+')) ' \ - 'or (inst_type=%s and inst_id in ('+str_d+'))', - (self._name,)+tuple(sub_ids)+(self._name,)+tuple(sub_ids)) if d1: cr.execute('delete from "'+self._table+'" ' \ 'where id in ('+str_d+')'+d1, sub_ids+d2) @@ -2086,7 +2082,6 @@ class orm(orm_template): upd0 += ','+self._inherits[table] upd1 += ',%d' upd2.append(id) - cr.execute('insert into inherit (obj_type,obj_id,inst_type,inst_id) values (%s,%d,%s,%d)', (table,id,self._name,id_new)) for field in vals: if self._columns[field]._classic_write: diff --git a/bin/osv/osv.py b/bin/osv/osv.py index 49099aa7142..2e8ba1114be 100644 --- a/bin/osv/osv.py +++ b/bin/osv/osv.py @@ -78,20 +78,8 @@ class osv_pool(netsvc.Service): 'Object %s doesn\'t exist' % str(obj)) if (not method in getattr(object,'_protected')) and len(args) \ and args[0] and len(object._inherits): - types = {obj: args[0]} - cr.execute('select inst_type,inst_id,obj_id \ - from inherit \ - where obj_type=%s \ - and obj_id in ('+','.join(map(str,args[0]))+')', (obj,)) - for ty,id,id2 in cr.fetchall(): - if not ty in types: - types[ty]=[] - types[ty].append(id) - types[obj].remove(id2) - for t,ids in types.items(): - if len(ids): - object_t = pooler.get_pool(cr.dbname).get(t) - res = getattr(object_t,method)(cr, uid, ids, *args[1:], **kw) + object_t = pooler.get_pool(cr.dbname).get(obj) + res = getattr(object_t,method)(cr, uid, args, **kw) else: res = getattr(object,method)(cr, uid, *args, **kw) return res diff --git a/bin/tools/graph.py b/bin/tools/graph.py index c14a3e2488b..c271726b79c 100644 --- a/bin/tools/graph.py +++ b/bin/tools/graph.py @@ -290,11 +290,14 @@ class graph(object): return self.result if __name__=='__main__': - starting_node = ['mrp'] # put here nodes with flow_start=True - nodes = ['project','account','hr','base','product','mrp','test'] + starting_node = ['profile'] # put here nodes with flow_start=True + nodes = ['project','account','hr','base','product','mrp','test','profile'] transitions = [ + ('profile','mrp'), ('mrp','project'), ('project','product'), + ('mrp','hr'), + ('mrp','test'), ('project','account'), ('project','hr'), ('product','base'),