[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:
commit
a2318ec968
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue