diff --git a/account_financial_report_qweb/README.rst b/account_financial_report_qweb/README.rst index 7836ebbb..b127e61d 100644 --- a/account_financial_report_qweb/README.rst +++ b/account_financial_report_qweb/README.rst @@ -52,6 +52,7 @@ Contributors * Julien Coux * Akim Juillerat * Alexis de Lattre +* Benjamin Willig Much of the work in this module was done at a sprint in Sorrento, Italy in April 2016. diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py index 010b0d7b..b943b367 100644 --- a/account_financial_report_qweb/report/general_ledger.py +++ b/account_financial_report_qweb/report/general_ledger.py @@ -210,10 +210,8 @@ class GeneralLedgerReportCompute(models.TransientModel): report_name=report_name) @api.multi - def compute_data_for_report(self, - with_line_details=True, - with_partners=True - ): + def compute_data_for_report( + self, with_line_details=True, with_partners=True): self.ensure_one() # Compute report data self._inject_account_values() @@ -253,8 +251,8 @@ class GeneralLedgerReportCompute(models.TransientModel): # Complete unaffected earnings account if (not self.filter_account_ids or - self.unaffected_earnings_account.id in - self.filter_account_ids.ids): + self.unaffected_earnings_account.id in + self.filter_account_ids.ids): self._complete_unaffected_earnings_account_values() if with_line_details: @@ -617,7 +615,7 @@ AND Only for "partner" accounts (payable and receivable). """ - + # pylint: disable=sql-injection query_inject_partner = """ WITH accounts_partners AS @@ -1324,6 +1322,7 @@ WHERE id = %s subquery_sum_amounts += """ ) sub """ + # pylint: disable=sql-injection query_inject_account = """ WITH initial_sum_amounts AS ( """ + subquery_sum_amounts + """ ) diff --git a/account_financial_report_qweb/report/general_ledger_xlsx.py b/account_financial_report_qweb/report/general_ledger_xlsx.py index 2f547bb8..a52f0ee9 100644 --- a/account_financial_report_qweb/report/general_ledger_xlsx.py +++ b/account_financial_report_qweb/report/general_ledger_xlsx.py @@ -40,12 +40,14 @@ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx): 'field_final_balance': 'final_debit', 'type': 'amount', 'width': 14}, - 10: {'header': _('Credit'), + 10: { + 'header': _('Credit'), 'field': 'credit', 'field_initial_balance': 'initial_credit', 'field_final_balance': 'final_credit', 'type': 'amount', - 'width': 14}, + 'width': 14 + }, 11: {'header': _('Cumul. Bal.'), 'field': 'cumul_balance', 'field_initial_balance': 'initial_balance', @@ -61,15 +63,23 @@ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx): def _get_report_filters(self, report): return [ - [_('Date range filter'), - _('From: %s To: %s') % (report.date_from, report.date_to)], - [_('Target moves filter'), + [ + _('Date range filter'), + _('From: %s To: %s') % (report.date_from, report.date_to), + ], + [ + _('Target moves filter'), _('All posted entries') if report.only_posted_moves - else _('All entries')], - [_('Account balance at 0 filter'), - _('Hide') if report.hide_account_balance_at_0 else _('Show')], - [_('Centralize filter'), - _('Yes') if report.centralize else _('No')], + else _('All entries'), + ], + [ + _('Account balance at 0 filter'), + _('Hide') if report.hide_account_balance_at_0 else _('Show'), + ], + [ + _('Centralize filter'), + _('Yes') if report.centralize else _('No'), + ], ] def _get_col_count_filter_name(self): diff --git a/account_financial_report_qweb/report/open_items.py b/account_financial_report_qweb/report/open_items.py index 5265fd00..3128d6f1 100644 --- a/account_financial_report_qweb/report/open_items.py +++ b/account_financial_report_qweb/report/open_items.py @@ -257,6 +257,7 @@ FROM def _inject_partner_values(self): """ Inject report values for report_open_items_qweb_partner. """ + # pylint: disable=sql-injection query_inject_partner = """ WITH accounts_partners AS diff --git a/account_financial_report_qweb/report/open_items_xlsx.py b/account_financial_report_qweb/report/open_items_xlsx.py index 63bd02fb..1d75c752 100644 --- a/account_financial_report_qweb/report/open_items_xlsx.py +++ b/account_financial_report_qweb/report/open_items_xlsx.py @@ -49,12 +49,19 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx): def _get_report_filters(self, report): return [ - [_('Date at filter'), report.date_at], - [_('Target moves filter'), + [ + _('Date at filter'), + report.date_at + ], + [ + _('Target moves filter'), _('All posted entries') if report.only_posted_moves - else _('All entries')], - [_('Account balance at 0 filter'), - _('Hide') if report.hide_account_balance_at_0 else _('Show')], + else _('All entries'), + ], + [ + _('Account balance at 0 filter'), + _('Hide') if report.hide_account_balance_at_0 else _('Show'), + ], ] def _get_col_count_filter_name(self):