Browse Source

[IMP] mis_builder: lint

pull/189/head
Stéphane Bidoul 8 years ago
parent
commit
c1adf834e9
  1. 1
      mis_builder/README.rst
  2. 8
      mis_builder/models/mis_report.py
  3. 28
      mis_builder/static/src/js/mis_builder.js

1
mis_builder/README.rst

@ -64,6 +64,7 @@ Known issues / Roadmap
======================
* V9 thoughts:
* select accounts by tag (see also select accounts by type below)
* how to handle multi-company consolidation now that consolidation children are gone?
* what replaces root accounts / account charts in v9? nothing it seems, so

8
mis_builder/models/mis_report.py

@ -529,7 +529,8 @@ class MisReportKpi(models.Model):
def _inverse_expression(self):
for kpi in self:
if kpi.multi:
raise UserError('Can not update a multi kpi from the kpi line')
raise UserError(_('Can not update a multi kpi from '
'the kpi line'))
if kpi.expression_ids:
kpi.expression_ids[0].write({
'name': kpi.expression,
@ -973,10 +974,11 @@ class MisReport(models.Model):
elif isinstance(vals[0], DataError):
vals = (vals[0],) * col.colspan
else:
raise UserError("Probably not your fault... but I'm "
raise UserError(_("Probably not your fault... but I'm "
"really curious to know how you "
"managed to raise this error so "
"I can handle one more corner case!")
"I can handle one more corner "
"case!"))
if len(drilldown_args) != col.colspan:
drilldown_args = [None] * col.colspan
kpi_matrix.set_values(

28
mis_builder/static/src/js/mis_builder.js

@ -22,8 +22,8 @@ var MisReport = form_common.FormWidget.extend({
},
reload_widget: function() {
var self = this
self.mis_report_instance_id = self.getParent().datarecord.id
var self = this;
self.mis_report_instance_id = self.getParent().datarecord.id;
if (self.mis_report_instance_id) {
self.generate_content();
}
@ -32,7 +32,7 @@ var MisReport = form_common.FormWidget.extend({
start: function() {
this._super.apply(this, arguments);
var self = this;
self.mis_report_instance_id = self.getParent().datarecord.id
self.mis_report_instance_id = self.getParent().datarecord.id;
if (self.mis_report_instance_id) {
self.getParent().dataset.context['no_destroy'] = true;
}
@ -40,7 +40,7 @@ var MisReport = form_common.FormWidget.extend({
get_context: function() {
var self = this;
var context = {}
var context = {};
if (this.mis_report_instance_id){
context['active_ids'] = [this.mis_report_instance_id];
}
@ -48,8 +48,8 @@ var MisReport = form_common.FormWidget.extend({
},
print: function() {
var self = this
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {})
var self = this;
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {});
new Model("mis.report.instance").call(
"print_pdf",
[self.mis_report_instance_id],
@ -59,8 +59,8 @@ var MisReport = form_common.FormWidget.extend({
});
},
export_pdf: function() {
var self = this
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {})
var self = this;
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {});
new Model("mis.report.instance").call(
"export_xls",
[self.mis_report_instance_id],
@ -70,8 +70,8 @@ var MisReport = form_common.FormWidget.extend({
});
},
display_settings: function() {
var self = this
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {})
var self = this;
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {});
new Model("mis.report.instance").call(
"display_settings",
[self.mis_report_instance_id],
@ -81,8 +81,8 @@ var MisReport = form_common.FormWidget.extend({
});
},
generate_content: function() {
var self = this
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {})
var self = this;
var context = new data.CompoundContext(self.build_context(), self.get_context()|| {});
new Model("mis.report.instance").call(
"compute",
[self.mis_report_instance_id],
@ -132,9 +132,9 @@ ActionManager.include({
* export, ...
*/
dialog_stop: function (reason) {
var self = this
var self = this;
if (self.dialog_widget && self.dialog_widget.dataset && self.dialog_widget.dataset.context) {
var context = self.dialog_widget.dataset.context
var context = self.dialog_widget.dataset.context;
if (!context['no_destroy']) {
this._super.apply(this, arguments);
}

Loading…
Cancel
Save