diff --git a/addons/web_mobile/static/src/js/form_mobile.js b/addons/web_mobile/static/src/js/form_mobile.js index 75058bbf8e9..598f3c29739 100644 --- a/addons/web_mobile/static/src/js/form_mobile.js +++ b/addons/web_mobile/static/src/js/form_mobile.js @@ -93,17 +93,9 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; var notebook=fields[get_fields[i].attrs.name].views.form.arch; - if(notebook){ - var til = notebook.attrs.string; - } } } } - } - - if(notebook){ - $(this).find('div#page_content').html(self.render({'get_fields': get_fields,'fields' : result.fields, 'values' : self.datarecord,'til': til })); - }else{ $(this).find('div#page_content').html(self.render({'get_fields': get_fields,'fields' : result.fields, 'values' : self.datarecord})); } self.formatdata(get_fields, fields, result, self.datarecord,'page_content','element'); @@ -186,6 +178,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ } if(!$('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html()){ $('
').appendTo('#moe'); + for (var k = 0; k < notebooks.children.length; k++) { if (notebooks.children[k].attrs.string == lastid) { get_fields = self.get_fields(notebooks.children[k].children); @@ -240,7 +233,11 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ } } }); - self.formatdata(get_fields_test, fields_test, result, data_relational,'oe_form_'+listid+result.fields[relational].relation,'element'); + if(notebook){ + self.formatdata(get_fields_test, fields_test, result, data_relational,'oe_form_'+listid+result.fields[relational].relation,'element'); + }else{ + self.formatdata(get_fields_test, fields, result, data_relational,'oe_form_'+listid+result.fields[relational].relation,'element'); + } $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); self.formatdata('', '', '', '','oe_form_'+listid+result.fields[relational].relation,'slider'); }else{ @@ -271,6 +268,9 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ if (view_fields[i].tag == 'level') { this.get_fields(view_fields[i].children, this.fields); } + if (view_fields[i].tag == 'page') { + this.get_fields(view_fields[i].children, this.fields); + } } return this.fields; }, diff --git a/addons/web_mobile/static/src/xml/web_mobile.xml b/addons/web_mobile/static/src/xml/web_mobile.xml index 9a07da21ebe..8299d40c171 100644 --- a/addons/web_mobile/static/src/xml/web_mobile.xml +++ b/addons/web_mobile/static/src/xml/web_mobile.xml @@ -168,7 +168,7 @@
- +
@@ -346,4 +347,4 @@
- + \ No newline at end of file