|
|
@ -21,20 +21,38 @@ var MisReport = form_common.FormWidget.extend({ |
|
|
|
this.field_manager.on("view_content_has_changed", this, this.reload_widget); |
|
|
|
}, |
|
|
|
|
|
|
|
reload_widget: function() { |
|
|
|
initialize_field: function() { |
|
|
|
var self = this; |
|
|
|
self.mis_report_instance_id = self.getParent().datarecord.id; |
|
|
|
if (self.mis_report_instance_id) { |
|
|
|
self.generate_content(); |
|
|
|
self.destroy_content(); |
|
|
|
self.init_fields(); |
|
|
|
}, |
|
|
|
|
|
|
|
init_fields: function() { |
|
|
|
var self = this; |
|
|
|
if (self.dfm) |
|
|
|
return; |
|
|
|
self.dfm = new form_common.DefaultFieldManager(self); |
|
|
|
self.$(".oe_mis_builder_generate_content").click(_.bind(this.generate_content, this)); |
|
|
|
}, |
|
|
|
|
|
|
|
destroy_content: function() { |
|
|
|
if (this.dfm) { |
|
|
|
this.dfm.destroy(); |
|
|
|
this.dfm = undefined; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
reload_widget: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
start: function() { |
|
|
|
this._super.apply(this, arguments); |
|
|
|
var self = this; |
|
|
|
self.mis_report_instance_id = self.getParent().datarecord.id; |
|
|
|
if (self.mis_report_instance_id) { |
|
|
|
self.getParent().dataset.context.no_destroy = true; |
|
|
|
self.generate_content(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -104,6 +122,7 @@ var MisReport = form_common.FormWidget.extend({ |
|
|
|
self.$(".oe_mis_builder_settings").show(); |
|
|
|
} |
|
|
|
}); |
|
|
|
self.initialize_field(); |
|
|
|
}, |
|
|
|
events: { |
|
|
|
"click a.mis_builder_drilldown": "drilldown", |
|
|
@ -144,4 +163,9 @@ ActionManager.include({ |
|
|
|
} |
|
|
|
}); |
|
|
|
core.form_custom_registry.add('mis_report', MisReport); |
|
|
|
|
|
|
|
return { |
|
|
|
MisReport: MisReport, |
|
|
|
}; |
|
|
|
|
|
|
|
}); |