diff --git a/addons/web/static/src/js/view_editor.js b/addons/web/static/src/js/view_editor.js index f5f1766b119..c86f9993856 100644 --- a/addons/web/static/src/js/view_editor.js +++ b/addons/web/static/src/js/view_editor.js @@ -41,12 +41,12 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ height: 500, buttons: { "Create": function(){ - + }, "Edit": function(){ self.xml_id = 0 ; self.get_data(); - + }, "Close": function(){ $(this).dialog('destroy'); @@ -54,7 +54,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ }, }); - this.dialog.start(); + this.dialog.start(); this.dialog.open(); action_manager.appendTo(this.dialog); action_manager.do_action(action); @@ -72,14 +72,14 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ att_list = _.select(att_list, function(attrs){ if (tag != 'button'){ if(attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index"){ - name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';} + name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';} }else{ if(attrs.nodeName == "name"){ - name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';} + name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';} } - }); + }); name1+= ">"; - }); + }); obj.name = name1; return obj; }, @@ -117,14 +117,14 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ child_obj_list.push(string); }); if(children_list.length != 0){ - parent_child_id.push({key: parent_id, value: child_obj_list}); - + var child_ids = _.map(child_obj_list ,function(num){return num.id;}); + parent_child_id.push({'key': parent_id, 'value': child_ids}); var parents = $(children_list[0]).parents().get(); if(parents.length <= parent_list.length){ parent_list.splice(parents.length-1);} parent_list.push(parent_id); $.each(main_object, function(key,val) { - self.save_object(val,parent_list.slice(1),child_obj_list); + self.save_object(val,parent_list.slice(1),child_obj_list); }); } for(var i=0;i level){ + cur_tr = nxt_tr; + nxt_tr.hide(); + }else break; + } + }, + on_collapse: function(self,parent_child_id){ + var id = self.id.split('-')[1]; + var datas = _.detect(parent_child_id,function(res){ + return res.key == id; + }); + _.each(datas.value,function(rec){ + var tr = $("tr[id='viewedit-"+rec+"']"); + tr.find("img[id='parentimg-"+rec+"']").attr('src','/web/static/src/img/expand.gif'); + tr.show(); + }); + } }); }; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 5f91ab46047..a0b4505155a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -640,8 +640,8 @@ - - + + - - + +
@@ -1280,7 +1280,7 @@
- + @@ -1296,6 +1296,7 @@ + Export