[FIX] domains and contexts on view switch to form, as well as fixing list of fields provided to DataSet.read_slice

bzr revid: xmo@openerp.com-20110720082455-ghudln3hhbmgjbum
This commit is contained in:
Xavier Morel 2011-07-20 10:24:55 +02:00
commit a2318ec968
2 changed files with 12 additions and 6 deletions

View File

@ -76,12 +76,20 @@ openerp.base_graph.GraphView = openerp.base.View.extend({
load_chart: function(data) {
var self = this;
var domain = false;
if(data){
this.x_title = this.all_fields[this.chart_info_fields]['string'];
this.y_title = this.all_fields[this.operator_field]['string'];
self.schedule_chart(data);
}else{
this.dataset.read_slice(this.fields, 0, false, function(res) {
if(! _.isEmpty(this.view_manager.dataset.domain)){
domain = this.view_manager.dataset.domain;
}else if(! _.isEmpty(this.view_manager.action.domain)){
domain = this.view_manager.action.domain;
}
this.dataset.domain = domain;
this.dataset.context = this.view_manager.dataset.context;
this.dataset.read_slice(_(this.fields).keys(), 0, false, function(res) {
self.schedule_chart(res);
});
}

View File

@ -1,6 +1,4 @@
<template>
<t t-name="GraphView">
<h2 class="oe_view_title"><t t-esc="fields_view.arch.attrs.string"/></h2>
<div t-att-id="elem_id+'-'+chart+'chart'" style="height:300px;position:relative;"></div>
</t>
</template>
<div t-name="GraphView" t-att-id="elem_id+'-'+chart+'chart'"
style="height:300px;position:relative;"/>
</template>