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. 12
      mis_builder/models/mis_report.py
  3. 28
      mis_builder/static/src/js/mis_builder.js
  4. 4
      mis_builder/static/src/xml/mis_widget.xml
  5. 4
      mis_builder/tests/mis.report.csv
  6. 4
      mis_builder/tests/mis.report.instance.csv
  7. 2
      mis_builder/tests/mis.report.query.csv
  8. 2
      mis_builder/wizard/mis_builder_dashboard.xml

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

12
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 "
"really curious to know how you "
"managed to raise this error so "
"I can handle one more corner case!")
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!"))
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);
}

4
mis_builder/static/src/xml/mis_widget.xml

@ -25,7 +25,7 @@
<tbody>
<tr t-foreach="widget.mis_report_data.body" t-as="row">
<td t-att="{'style': row.style}">
<t t-esc="row.label"/>
<t t-esc="row.label"/>
<t t-if="row.description">
<br/>
<t t-esc="row.description"/>
@ -47,7 +47,7 @@
</tr>
</tbody>
<tfoot>
<tr></tr>
<tr></tr>
</tfoot>
</table>
</t>

4
mis_builder/tests/mis.report.csv

@ -1,2 +1,2 @@
"id","description","kpi_ids/id","name","query_ids/id"
"mis_report_test","","mis_report_kpi_test","Test report","mis_report_query_test"
"id","description","kpi_ids/id","name","query_ids/id"
"mis_report_test","","mis_report_kpi_test","Test report","mis_report_query_test"

4
mis_builder/tests/mis.report.instance.csv

@ -1,2 +1,2 @@
"id","date","description","name","period_ids/id","report_id/id"
"mis_report_instance_test","2014-07-31","","Test-report-instance without company","mis_report_instance_period_test","mis_report_test"
"id","date","description","name","period_ids/id","report_id/id"
"mis_report_instance_test","2014-07-31","","Test-report-instance without company","mis_report_instance_period_test","mis_report_test"

2
mis_builder/tests/mis.report.query.csv

@ -1,2 +1,2 @@
"id","date_field/id","domain","field_ids/id","model_id/id","name"
"mis_report_query_test","analytic.field_account_analytic_line_date","","analytic.field_account_analytic_line_amount","analytic.model_account_analytic_line","test"
"mis_report_query_test","analytic.field_account_analytic_line_date","","analytic.field_account_analytic_line_amount","analytic.model_account_analytic_line","test"

2
mis_builder/wizard/mis_builder_dashboard.xml

@ -30,4 +30,4 @@
</record>
</data>
</openerp>
</openerp>
Loading…
Cancel
Save