|
|
@ -24,14 +24,23 @@ var MisReport = form_common.FormWidget.extend({ |
|
|
|
reload_widget: function() { |
|
|
|
var self = this |
|
|
|
self.mis_report_instance_id = self.getParent().datarecord.id |
|
|
|
self.generate_content(); |
|
|
|
if (self.mis_report_instance_id) { |
|
|
|
self.generate_content(); |
|
|
|
} else { |
|
|
|
self.display_settings(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
start: function() { |
|
|
|
this._super.apply(this, arguments); |
|
|
|
var self = this; |
|
|
|
self.mis_report_instance_id = self.getParent().datarecord.id |
|
|
|
self.generate_content(); |
|
|
|
if (self.mis_report_instance_id) { |
|
|
|
self.getParent().dataset.context['no_destroy'] = true; |
|
|
|
self.generate_content(); |
|
|
|
} else { |
|
|
|
self.display_settings(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
get_context: function() { |
|
|
@ -94,7 +103,7 @@ var MisReport = form_common.FormWidget.extend({ |
|
|
|
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)); |
|
|
|
var Users = new instance.web.Model('res.users'); |
|
|
|
var Users = new Model('res.users'); |
|
|
|
Users.call('has_group', ['account.group_account_user']).done(function (res) { |
|
|
|
if (res) { |
|
|
|
self.$(".oe_mis_builder_settings").show(); |
|
|
|