Browse Source

[FIX] pylint

pull/512/head
Iryna Vushnevska 5 years ago
committed by Iryna Vyshnevska
parent
commit
8b894d0c0b
  1. 1
      account_financial_report/models/account_move_line.py
  2. 1
      account_financial_report/report/open_items.py
  3. 15
      account_financial_report/static/src/js/account_financial_report_backend.js
  4. 20
      account_financial_report/static/src/js/account_financial_report_widgets.js
  5. 10
      account_financial_report/tests/test_general_ledger.py
  6. 9
      account_financial_report/tests/test_open_items.py

1
account_financial_report/models/account_move_line.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from odoo import api, models

1
account_financial_report/report/open_items.py

@ -638,6 +638,7 @@ ORDER BY
self._compute_account_cumul()
def _compute_partner_cumul(self):
# pylint: disable=sql-injection
where_condition_partner_by_account = """
WHERE
id IN

15
account_financial_report/static/src/js/account_financial_report_backend.js

@ -4,7 +4,9 @@ odoo.define('account_financial_report.account_financial_report_backend', functio
var core = require('web.core');
var Widget = require('web.Widget');
var ControlPanelMixin = require('web.ControlPanelMixin');
var ReportWidget = require('account_financial_report.account_financial_report_widget');
var ReportWidget = require(
'account_financial_report.account_financial_report_widget'
);
var report_backend = Widget.extend(ControlPanelMixin, {
@ -21,7 +23,8 @@ var report_backend = Widget.extend(ControlPanelMixin, {
if (action.context.context) {
this.given_context = action.context.context;
}
this.given_context.active_id = action.context.active_id || action.params.active_id;
this.given_context.active_id = action.context.active_id ||
action.params.active_id;
this.given_context.model = action.context.active_model || false;
this.given_context.ttype = action.context.ttype || false;
return this._super.apply (this, arguments);
@ -60,7 +63,8 @@ var report_backend = Widget.extend(ControlPanelMixin, {
return $.when.apply($, defs);
});
},
// Updates the control panel and render the elements that have yet to be rendered
// Updates the control panel and render the elements that have yet
// to be rendered
update_cp: function () {
if (this.$buttons) {
var status = {
@ -99,6 +103,9 @@ var report_backend = Widget.extend(ControlPanelMixin, {
},
});
core.action_registry.add("account_financial_report_backend", report_backend);
core.action_registry.add(
"account_financial_report_backend",
report_backend
);
return report_backend;
});

20
account_financial_report/static/src/js/account_financial_report_widgets.js

@ -7,10 +7,14 @@ var Widget = require('web.Widget');
var accountFinancialReportWidget = Widget.extend({
events: {
'click .o_account_financial_reports_web_action': 'boundLink',
'click .o_account_financial_reports_web_action_multi': 'boundLinkmulti',
'click .o_account_financial_reports_web_action_monetary': 'boundLinkMonetary',
'click .o_account_financial_reports_web_action_monetary_multi': 'boundLinkMonetarymulti',
'click .o_account_financial_reports_web_action':
'boundLink',
'click .o_account_financial_reports_web_action_multi':
'boundLinkmulti',
'click .o_account_financial_reports_web_action_monetary':
'boundLinkMonetary',
'click .o_account_financial_reports_web_action_monetary_multi':
'boundLinkMonetarymulti',
},
init: function () {
this._super.apply(this, arguments);
@ -26,7 +30,7 @@ var accountFinancialReportWidget = Widget.extend({
res_model: res_model,
res_id: res_id,
views: [[false, 'form']],
target: 'current'
target: 'current',
});
},
boundLinkmulti: function (e) {
@ -37,7 +41,7 @@ var accountFinancialReportWidget = Widget.extend({
res_model: res_model,
domain: domain,
views: [[false, "list"], [false, "form"]],
target: 'current'
target: 'current',
});
},
boundLinkMonetary: function (e) {
@ -48,7 +52,7 @@ var accountFinancialReportWidget = Widget.extend({
res_model: res_model,
res_id: res_id,
views: [[false, 'form']],
target: 'current'
target: 'current',
});
},
boundLinkMonetarymulti: function (e) {
@ -59,7 +63,7 @@ var accountFinancialReportWidget = Widget.extend({
res_model: res_model,
domain: domain,
views: [[false, "list"], [false, "form"]],
target: 'current'
target: 'current',
});
},
});

10
account_financial_report/tests/test_general_ledger.py

@ -4,7 +4,6 @@
import time
from odoo.api import Environment
from odoo.tests import common
from . import abstract_test_foreign_currency as a_t_f_c
@ -505,9 +504,12 @@ class TestGeneralLedgerReport(common.TransactionCase):
partner_3.write({'is_company': False})
expected_list = [partner_2.id, partner_3.id, partner_4.id]
context = {'active_ids': [
partner_1.id, partner_2.id, partner_3.id, partner_4.id],
'active_model': 'res.partner'}
context = {
'active_ids': [
partner_1.id, partner_2.id, partner_3.id, partner_4.id
],
'active_model': 'res.partner'
}
wizard = self.env["general.ledger.report.wizard"].with_context(context)
self.assertEqual(wizard._default_partners(), expected_list)

9
account_financial_report/tests/test_open_items.py

@ -50,9 +50,12 @@ class TestOpenItems(a_t_f_c.AbstractTestForeignCurrency):
partner_3.write({'is_company': False})
expected_list = [partner_2.id, partner_3.id, partner_4.id]
context = {'active_ids': [
partner_1.id, partner_2.id, partner_3.id, partner_4.id],
'active_model': 'res.partner'}
context = {
'active_ids': [
partner_1.id, partner_2.id, partner_3.id, partner_4.id
],
'active_model': 'res.partner'
}
wizard = self.env["open.items.report.wizard"].with_context(context)
self.assertEqual(wizard._default_partners(), expected_list)
Loading…
Cancel
Save