|
|
@ -7,13 +7,20 @@ openerp.mis_builder = function(instance) { |
|
|
|
this._super.apply(this, arguments); |
|
|
|
this.mis_report_data = null; |
|
|
|
this.mis_report_instance_id = false; |
|
|
|
this.field_manager.on("view_content_has_changed", this, this.reload_widget); |
|
|
|
}, |
|
|
|
|
|
|
|
reload_widget: function() { |
|
|
|
var self = this |
|
|
|
self.mis_report_instance_id = self.getParent().datarecord.id |
|
|
|
self.generate_content(); |
|
|
|
}, |
|
|
|
|
|
|
|
start: function() { |
|
|
|
this._super.apply(this, arguments); |
|
|
|
var self = this; |
|
|
|
self.mis_report_instance_id = self.getParent().dataset.context.active_id |
|
|
|
self.getParent().dataset.context['no_destroy'] = true; |
|
|
|
self.mis_report_instance_id = self.getParent().datarecord.id |
|
|
|
//self.getParent().dataset.context['no_destroy'] = true;
|
|
|
|
self.generate_content(); |
|
|
|
}, |
|
|
|
|
|
|
@ -44,9 +51,18 @@ openerp.mis_builder = function(instance) { |
|
|
|
[self.mis_report_instance_id], |
|
|
|
{'context': context} |
|
|
|
).then(function(result){ |
|
|
|
self.do_action(result).done(function(result){ |
|
|
|
a = 2; |
|
|
|
}); |
|
|
|
self.do_action(result); |
|
|
|
}); |
|
|
|
}, |
|
|
|
display_settings: function() { |
|
|
|
var self = this |
|
|
|
context = new instance.web.CompoundContext(self.build_context(), self.get_context()|| {}) |
|
|
|
new instance.web.Model("mis.report.instance").call( |
|
|
|
"display_settings", |
|
|
|
[self.mis_report_instance_id], |
|
|
|
{'context': context} |
|
|
|
).then(function(result){ |
|
|
|
self.do_action(result); |
|
|
|
}); |
|
|
|
}, |
|
|
|
generate_content: function() { |
|
|
@ -66,6 +82,7 @@ openerp.mis_builder = function(instance) { |
|
|
|
var self = this; |
|
|
|
self.$(".oe_mis_builder_print").click(_.bind(this.print, this)); |
|
|
|
self.$(".oe_mis_builder_export").click(_.bind(this.export_pdf, this)); |
|
|
|
self.$(".oe_mis_builder_settings").click(_.bind(this.display_settings, this)); |
|
|
|
}, |
|
|
|
events: { |
|
|
|
"click a.mis_builder_drilldown": "drilldown", |
|
|
|