[FIX] Fixing issues related o2m relational field in notebook.
bzr revid: bth@tinyerp.com-20111110064145-trcvnzyibt4wxwf9
This commit is contained in:
@@ -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()){
|
||||
$('<div id="oe_form_'+listid+result.fields[relational].relation+'" data-role="page" data-url="oe_form_'+listid+result.fields[relational].relation+'"> </div>').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;
|
||||
},
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
</t>
|
||||
<div data-role="content">
|
||||
<form>
|
||||
<t t-foreach="get_fields" t-as="field">
|
||||
<t t-foreach="get_fields" t-as="field">
|
||||
<div data-role="fieldcontain">
|
||||
<t t-if="fields[field.attrs.name].type == 'char'">
|
||||
<label t-att-for="field.attrs.name">
|
||||
@@ -295,16 +295,17 @@
|
||||
<select id="" data-native-menu="false" t-att-for="fields[field.attrs.name].relation">
|
||||
<t t-if="fields[field.attrs.name].selection">
|
||||
<t t-foreach="fields[field.attrs.name].selection" t-as="opt">
|
||||
<t t-if="values[field.attrs.name]==opt[0]">
|
||||
|
||||
<t t-if="values[field.attrs.name] and values[field.attrs.name]==opt[0]">
|
||||
<option t-att-value="opt[0]" selected="true" ><t t-esc="opt[1]"/></option>
|
||||
</t>
|
||||
<t t-if="values[field.attrs.name]!=opt[0]">
|
||||
<t t-if="values[field.attrs.name] and values[field.attrs.name]!=opt[0]">
|
||||
<option t-att-value="opt[0]" ><t t-esc="opt[1]"/></option>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="!fields[field.attrs.name].selection">
|
||||
<option t-att-value="values[field.attrs.name][0]" ><t t-esc="values[field.attrs.name][1]"/></option>
|
||||
<t t-if="values[field.attrs.name] and !fields[field.attrs.name].selection">
|
||||
<option t-att-value="values[field.attrs.name][0]" ><t t-esc="values[field.attrs.name][1]"/></option>
|
||||
</t>
|
||||
</select>
|
||||
<t t-if="fields[field.attrs.name].selection">
|
||||
@@ -313,11 +314,11 @@
|
||||
</t>
|
||||
<t t-if="fields[field.attrs.name].type == 'one2many'">
|
||||
<ul data-role="listview" data-inset="true" data-theme="d">
|
||||
<li data-theme="c" t-att-for="field.attrs.name">
|
||||
<li data-theme="c" t-att-for="field.attrs.name" >
|
||||
<a href="">
|
||||
<t t-esc="til"/>
|
||||
<t t-esc="fields[field.attrs.name].string"/>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
</div>
|
||||
@@ -346,4 +347,4 @@
|
||||
<t t-call="Footer" />
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user