From 4f38153c97861e018cbaad4e610d0e57eca380e4 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 24 Mar 2016 12:41:42 +0100 Subject: [PATCH] [FIX] PEP8 + pylint --- account_chart_report/__openerp__.py | 3 +- account_financial_report/__openerp__.py | 4 +- account_financial_report/model/__init__.py | 3 +- .../model/account_financial_report.py | 2 +- account_financial_report/model/res_company.py | 3 +- account_financial_report/report/__init__.py | 2 +- account_financial_report/report/parser.py | 63 ++++++++++--------- account_financial_report/wizard/wizard.py | 49 ++++++--------- .../__openerp__.py | 1 + .../report/account_balance_sheet.py | 6 +- .../report/account_profit_loss.py | 5 +- account_financial_report_webkit/__init__.py | 2 +- .../__openerp__.py | 2 +- .../account_move_line.py | 2 +- .../report/aged_partner_balance.py | 10 +-- .../report/common_balance_reports.py | 2 +- .../report/common_partner_balance_reports.py | 2 +- .../report/common_partner_reports.py | 2 +- .../report/common_reports.py | 6 +- .../report/general_ledger.py | 2 +- .../report/open_invoices.py | 6 +- .../report/partner_balance.py | 2 +- .../report/partners_ledger.py | 6 +- .../report/print_journal.py | 2 - .../report/trial_balance.py | 2 +- .../report/webkit_parser_header_fix.py | 5 +- .../wizard/general_ledger_wizard.py | 2 +- .../wizard/open_invoices_wizard.py | 2 +- .../wizard/partner_balance_wizard.py | 2 +- .../wizard/partners_ledger_wizard.py | 2 +- .../wizard/trial_balance_wizard.py | 2 +- .../__init__.py | 2 +- .../__openerp__.py | 2 +- .../report/__init__.py | 2 +- .../report/general_ledger_xls.py | 2 +- .../report/open_invoices_xls.py | 35 ++++++----- .../report/partner_ledger_xls.py | 2 +- .../report/partners_balance_xls.py | 9 +-- .../report/trial_balance_xls.py | 7 ++- .../wizard/__init__.py | 2 +- .../wizard/general_ledger_wizard.py | 2 +- .../wizard/open_invoices_wizard.py | 2 +- .../wizard/partners_balance_wizard.py | 2 +- .../wizard/partners_ledger_wizard.py | 2 +- .../wizard/trial_balance_wizard.py | 2 +- account_journal_report_xls/__init__.py | 2 +- account_journal_report_xls/__openerp__.py | 2 +- account_journal_report_xls/account_journal.py | 2 +- account_journal_report_xls/report/__init__.py | 2 +- .../report/nov_account_journal.py | 22 +++---- .../report/nov_account_journal_xls.py | 2 +- account_journal_report_xls/wizard/__init__.py | 2 +- .../wizard/print_journal_wizard.py | 2 +- .../__init__.py | 2 +- .../__openerp__.py | 6 +- .../partner_aged_statement.py | 2 +- .../report/__init__.py | 2 +- .../report/partner_aged_statement_report.py | 4 +- .../report/supplier_aged_statement_report.py | 2 +- .../tests/test_aged_statement.py | 2 +- 60 files changed, 164 insertions(+), 169 deletions(-) mode change 100755 => 100644 account_financial_report/model/__init__.py mode change 100755 => 100644 account_financial_report/model/res_company.py diff --git a/account_chart_report/__openerp__.py b/account_chart_report/__openerp__.py index 3d3ba960..6944f479 100644 --- a/account_chart_report/__openerp__.py +++ b/account_chart_report/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution @@ -44,6 +44,7 @@ Contributors 'base', 'account', ], + "license": 'AGPL-3', 'data': [ 'account_report.xml', 'wizard/account_report_chart_of_account.xml', diff --git a/account_financial_report/__openerp__.py b/account_financial_report/__openerp__.py index 338e4836..3d10a7fe 100644 --- a/account_financial_report/__openerp__.py +++ b/account_financial_report/__openerp__.py @@ -1,7 +1,6 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Copyright (C) OpenERP Venezuela (). -# All Rights Reserved # Credits###################################################### # Coded by: Humberto Arocha humberto@openerp.com.ve # Angelica Barrios angelicaisabelb@gmail.com @@ -28,6 +27,7 @@ "version": "2.0", "author": "Vauxoo,Odoo Community Association (OCA)", "website": "http://www.vauxoo.com", + "license": "AGPL-3", "depends": ["base", "account" ], diff --git a/account_financial_report/model/__init__.py b/account_financial_report/model/__init__.py old mode 100755 new mode 100644 index bb6a98b0..5b087c64 --- a/account_financial_report/model/__init__.py +++ b/account_financial_report/model/__init__.py @@ -1,5 +1,4 @@ -#!/usr/bin/python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (). diff --git a/account_financial_report/model/account_financial_report.py b/account_financial_report/model/account_financial_report.py index 9b4d28b6..e4613bc5 100644 --- a/account_financial_report/model/account_financial_report.py +++ b/account_financial_report/model/account_financial_report.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (). diff --git a/account_financial_report/model/res_company.py b/account_financial_report/model/res_company.py old mode 100755 new mode 100644 index 639f29c4..e858e7a0 --- a/account_financial_report/model/res_company.py +++ b/account_financial_report/model/res_company.py @@ -1,5 +1,4 @@ -#!/usr/bin/python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (). diff --git a/account_financial_report/report/__init__.py b/account_financial_report/report/__init__.py index ab266206..db553030 100644 --- a/account_financial_report/report/__init__.py +++ b/account_financial_report/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (). diff --git a/account_financial_report/report/parser.py b/account_financial_report/report/parser.py index c4d308ad..8cd8edcf 100644 --- a/account_financial_report/report/parser.py +++ b/account_financial_report/report/parser.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (). @@ -164,19 +164,19 @@ class account_balance(report_sxw.rml_parse): return False def exchange_name(self, form): - self.from_currency_id = self.\ - get_company_currency(form['company_id'] - and type(form['company_id']) in (list, tuple) - and form['company_id'][0] - or form['company_id']) + self.from_currency_id = self.get_company_currency( + form['company_id'] and + type(form['company_id']) in (list, tuple) and + form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] \ - and type(form['currency_id']) in (list, tuple) \ - and form['currency_id'][0] or form['currency_id'] - return self.pool.get('res.currency').browse(self.cr, self.uid, - self.to_currency_id).name + self.to_currency_id = ( + form['currency_id'] and + type(form['currency_id']) in (list, tuple) and + form['currency_id'][0] or form['currency_id']) + return self.pool.get('res.currency').browse( + self.cr, self.uid, self.to_currency_id).name def exchange(self, from_amount): if self.from_currency_id == self.to_currency_id: @@ -548,10 +548,10 @@ class account_balance(report_sxw.rml_parse): self.context['state'] = form['target_move'] or 'posted' self.from_currency_id = self.\ - get_company_currency(form['company_id'] - and type(form['company_id']) in (list, tuple) - and form['company_id'][0] - or form['company_id']) + get_company_currency(form['company_id'] and + type(form['company_id']) in (list, tuple) and + form['company_id'][0] or + form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: @@ -566,16 +566,16 @@ class account_balance(report_sxw.rml_parse): del form['account_list'] credit_account_ids = self.\ - get_company_accounts(form['company_id'] - and type(form['company_id']) in (list, tuple) - and form['company_id'][0] - or form['company_id'], 'credit') + get_company_accounts(form['company_id'] and + type(form['company_id']) in (list, tuple) and + form['company_id'][0] or + form['company_id'], 'credit') debit_account_ids = self.\ - get_company_accounts(form['company_id'] - and type(form['company_id']) in (list, tuple) - and form['company_id'][0] - or form['company_id'], 'debit') + get_company_accounts(form['company_id'] and + type(form['company_id']) in (list, tuple) and + form['company_id'][0] or + form['company_id'], 'debit') if form.get('fiscalyear'): if type(form.get('fiscalyear')) in (list, tuple): @@ -592,9 +592,9 @@ class account_balance(report_sxw.rml_parse): account_ids = _get_children_and_consol( self.cr, self.uid, account_ids, - form['display_account_level'] - and form['display_account_level'] - or 100, self.context) + form['display_account_level'] and + form['display_account_level'] or + 100, self.context) credit_account_ids = _get_children_and_consol( self.cr, self.uid, credit_account_ids, 100, self.context, @@ -850,15 +850,16 @@ class account_balance(report_sxw.rml_parse): 'id': id, 'type': aa_id[3].type, 'code': aa_id[3].code, - 'name': (aa_id[2] and not aa_id[1]) - and 'TOTAL %s' % (aa_id[3].name.upper()) - or aa_id[3].name, + 'name': ((aa_id[2] and not aa_id[1]) and + 'TOTAL %s' % (aa_id[3].name.upper()) or + aa_id[3].name), 'parent_id': aa_id[3].parent_id and aa_id[3].parent_id.id, 'level': aa_id[3].level, 'label': aa_id[1], 'total': aa_id[2], - 'change_sign': credit_account_ids - and (id in credit_account_ids and -1 or 1) or 1 + 'change_sign': ( + credit_account_ids and + (id in credit_account_ids and -1 or 1) or 1), } if form['columns'] == 'qtr': diff --git a/account_financial_report/wizard/wizard.py b/account_financial_report/wizard/wizard.py index 717300a9..576bb8e1 100644 --- a/account_financial_report/wizard/wizard.py +++ b/account_financial_report/wizard/wizard.py @@ -1,8 +1,7 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (). -# All Rights Reserved # Credits###################################################### # Coded by: Humberto Arocha humberto@openerp.com.ve # Angelica Barrios angelicaisabelb@gmail.com @@ -207,30 +206,22 @@ class wizard_report(osv.osv_memory): if not afr_id: return res afr_brw = self.pool.get('afr').browse(cr, uid, afr_id, context=context) - res['value'].update({ - 'currency_id': afr_brw.currency_id - and afr_brw.currency_id.id - or afr_brw.company_id.currency_id.id}) - res['value'].update({'inf_type': afr_brw.inf_type or 'BS'}) - res['value'].update({'columns': afr_brw.columns or 'five'}) - res['value'].update({ - 'display_account': afr_brw.display_account - or 'bal_mov'}) - res['value'].update({ - 'display_account_level': afr_brw. - display_account_level or 0}) - res['value'].update({ - 'fiscalyear': afr_brw.fiscalyear_id - and afr_brw.fiscalyear_id.id}) - res['value'].update({'account_list': [ - acc.id for acc in afr_brw.account_ids]}) - res['value'].update({'periods': [p.id for p in afr_brw.period_ids]}) - res['value'].update({ - 'analytic_ledger': - afr_brw.analytic_ledger or False}) - res['value'].update({'tot_check': afr_brw.tot_check or False}) - res['value'].update({'lab_str': afr_brw.lab_str or _( - 'Write a Description for your Summary Total')}) + res['value']['currency_id'] = ( + afr_brw.currency_id and afr_brw.currency_id.id or + afr_brw.company_id.currency_id.id) + res['value']['inf_type'] = afr_brw.inf_type or 'BS' + res['value']['columns'] = afr_brw.columns or 'five' + res['value']['display_account'] = afr_brw.display_account or 'bal_mov' + res['value']['display_account_level'] = ( + afr_brw.display_account_level or 0) + res['value']['fiscalyear'] = ( + afr_brw.fiscalyear_id and afr_brw.fiscalyear_id.id) + res['value']['account_list'] = [acc.id for acc in afr_brw.account_ids] + res['value']['periods'] = [p.id for p in afr_brw.period_ids] + res['value']['analytic_ledger'] = afr_brw.analytic_ledger or False + res['value']['tot_check'] = afr_brw.tot_check or False + res['value']['lab_str'] = afr_brw.lab_str or _( + 'Write a Description for your Summary Total') return res def _get_defaults(self, cr, uid, data, context=None): @@ -270,8 +261,8 @@ class wizard_report(osv.osv_memory): res = cr.dictfetchall() if res: - if (data['form']['date_to'] > res[0]['date_stop'] - or data['form']['date_from'] < res[0]['date_start']): + if (data['form']['date_to'] > res[0]['date_stop'] or + data['form']['date_from'] < res[0]['date_start']): raise osv.except_osv(_('UserError'), 'Las fechas deben estar entre %s y %s' % (res[0]['date_start'], @@ -369,5 +360,3 @@ class wizard_report(osv.osv_memory): return {'type': 'ir.actions.report.xml', 'report_name': name, 'datas': data} - -wizard_report() diff --git a/account_financial_report_horizontal/__openerp__.py b/account_financial_report_horizontal/__openerp__.py index 9f7dc6d2..676e329a 100644 --- a/account_financial_report_horizontal/__openerp__.py +++ b/account_financial_report_horizontal/__openerp__.py @@ -33,6 +33,7 @@ This is a port to OpenERP 7.0 of the horizontal financial reports 'website': 'https://launchpad.net/account-financial-report', 'images': [], "depends": ["account"], + "license": "AGPL-3", 'data': [ 'menu.xml', 'account_report.xml', diff --git a/account_financial_report_horizontal/report/account_balance_sheet.py b/account_financial_report_horizontal/report/account_balance_sheet.py index 71396f77..e59c0ade 100644 --- a/account_financial_report_horizontal/report/account_balance_sheet.py +++ b/account_financial_report_horizontal/report/account_balance_sheet.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -161,8 +161,8 @@ class report_balancesheet_horizontal( 'type': account.type, } currency = ( - account.currency_id and account.currency_id - or account.company_id.currency_id + account.currency_id and account.currency_id or + account.company_id.currency_id ) if typ == 'liability' and account.type != 'view' and ( account.debit != account.credit diff --git a/account_financial_report_horizontal/report/account_profit_loss.py b/account_financial_report_horizontal/report/account_profit_loss.py index 16acde40..846147d9 100644 --- a/account_financial_report_horizontal/report/account_profit_loss.py +++ b/account_financial_report_horizontal/report/account_profit_loss.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -135,8 +136,8 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): account.user_type.report_type == typ ): currency = ( - account.currency_id and account.currency_id - or account.company_id.currency_id) + account.currency_id and account.currency_id or + account.company_id.currency_id) if typ == 'expense' and account.type != 'view' and ( account.debit != account.credit ): diff --git a/account_financial_report_webkit/__init__.py b/account_financial_report_webkit/__init__.py index 7cdea65e..3703d696 100644 --- a/account_financial_report_webkit/__init__.py +++ b/account_financial_report_webkit/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 41df04f8..a937cfc0 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Authors: Nicolas Bessi, Guewen Baconnier diff --git a/account_financial_report_webkit/account_move_line.py b/account_financial_report_webkit/account_move_line.py index 882ce99f..ea986303 100644 --- a/account_financial_report_webkit/account_move_line.py +++ b/account_financial_report_webkit/account_move_line.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. diff --git a/account_financial_report_webkit/report/aged_partner_balance.py b/account_financial_report_webkit/report/aged_partner_balance.py index fa0110b3..69749297 100644 --- a/account_financial_report_webkit/report/aged_partner_balance.py +++ b/account_financial_report_webkit/report/aged_partner_balance.py @@ -309,10 +309,12 @@ class AccountAgedTrialBalanceWebkit(PartnersOpenInvoicesWebkit): :returns: delta in days """ - sale_lines = [x for x in ledger_lines if x['jtype'] in REC_PAY_TYPE - and line['rec_id'] == x['rec_id']] - refund_lines = [x for x in ledger_lines if x['jtype'] in REFUND_TYPE - and line['rec_id'] == x['rec_id']] + sale_lines = [ + x for x in ledger_lines if x['jtype'] in REC_PAY_TYPE and + line['rec_id'] == x['rec_id']] + refund_lines = [ + x for x in ledger_lines if x['jtype'] in REFUND_TYPE and + line['rec_id'] == x['rec_id']] if len(sale_lines) == 1: reference_line = sale_lines[0] elif len(refund_lines) == 1: diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index bc2d2c04..e61cc345 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit/report/common_partner_balance_reports.py b/account_financial_report_webkit/report/common_partner_balance_reports.py index 0be7f22b..e7e0e80a 100644 --- a/account_financial_report_webkit/report/common_partner_balance_reports.py +++ b/account_financial_report_webkit/report/common_partner_balance_reports.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit/report/common_partner_reports.py b/account_financial_report_webkit/report/common_partner_reports.py index 55ce8efd..ced7cf22 100644 --- a/account_financial_report_webkit/report/common_partner_reports.py +++ b/account_financial_report_webkit/report/common_partner_reports.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier diff --git a/account_financial_report_webkit/report/common_reports.py b/account_financial_report_webkit/report/common_reports.py index fbbf1e5a..393bc372 100644 --- a/account_financial_report_webkit/report/common_reports.py +++ b/account_financial_report_webkit/report/common_reports.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier @@ -131,8 +131,8 @@ class CommonReportHeaderWebkit(common_report_header): sorted_accounts = [] # add all accounts with same parent level_accounts = [account for account in accounts - if account['parent_id'] - and account['parent_id'][0] == parent['id']] + if account['parent_id'] and + account['parent_id'][0] == parent['id']] # add consolidation children of parent, as they are logically on # the same level if parent.get('child_consol_ids'): diff --git a/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py index 15f68e9b..6f77979a 100644 --- a/account_financial_report_webkit/report/general_ledger.py +++ b/account_financial_report_webkit/report/general_ledger.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index a15652e2..5082889a 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier @@ -157,8 +157,8 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, non_null_init_balances = dict([ (ib, amounts) for ib, amounts in account.init_balance.iteritems() - if amounts['init_balance'] - or amounts['init_balance_currency']]) + if amounts['init_balance'] or + amounts['init_balance_currency']]) init_bal_lines_pids = non_null_init_balances.keys() account.partners_order = self._order_partners( diff --git a/account_financial_report_webkit/report/partner_balance.py b/account_financial_report_webkit/report/partner_balance.py index 66d11a4c..35939a14 100644 --- a/account_financial_report_webkit/report/partner_balance.py +++ b/account_financial_report_webkit/report/partner_balance.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index 160b1ce2..76ba7bf8 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier @@ -159,8 +159,8 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, non_null_init_balances = dict( [(ib, amounts) for ib, amounts in account.init_balance.iteritems() - if amounts['init_balance'] - or amounts['init_balance_currency']]) + if amounts['init_balance'] or + amounts['init_balance_currency']]) init_bal_lines_pids = non_null_init_balances.keys() else: account.init_balance = {} diff --git a/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py index 60a4c61f..efd45cbc 100644 --- a/account_financial_report_webkit/report/print_journal.py +++ b/account_financial_report_webkit/report/print_journal.py @@ -161,5 +161,3 @@ HeaderFooterTextWebKitParser( 'addons/account_financial_report_webkit/report/templates/\ account_report_print_journal.mako', parser=PrintJournalWebkit) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_financial_report_webkit/report/trial_balance.py b/account_financial_report_webkit/report/trial_balance.py index 27c202b5..2656a9f3 100644 --- a/account_financial_report_webkit/report/trial_balance.py +++ b/account_financial_report_webkit/report/trial_balance.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit/report/webkit_parser_header_fix.py b/account_financial_report_webkit/report/webkit_parser_header_fix.py index 895c2cb0..b394d65c 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -43,8 +43,6 @@ from openerp import tools from openerp.addons.report_webkit import webkit_report from openerp.addons.report_webkit.report_helper import WebKitHelper -_logger = logging.getLogger('financial.reports.webkit') - # Class used only as a workaround to bug: # http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 @@ -79,6 +77,9 @@ from mako.template import Template from mako.lookup import TemplateLookup +_logger = logging.getLogger('financial.reports.webkit') + + def mako_template(text): """Build a Mako template. diff --git a/account_financial_report_webkit/wizard/general_ledger_wizard.py b/account_financial_report_webkit/wizard/general_ledger_wizard.py index f13a5816..84d4733a 100644 --- a/account_financial_report_webkit/wizard/general_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/general_ledger_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier diff --git a/account_financial_report_webkit/wizard/open_invoices_wizard.py b/account_financial_report_webkit/wizard/open_invoices_wizard.py index 7b57423c..20159617 100644 --- a/account_financial_report_webkit/wizard/open_invoices_wizard.py +++ b/account_financial_report_webkit/wizard/open_invoices_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit/wizard/partner_balance_wizard.py b/account_financial_report_webkit/wizard/partner_balance_wizard.py index 36bbe420..d9b0e748 100644 --- a/account_financial_report_webkit/wizard/partner_balance_wizard.py +++ b/account_financial_report_webkit/wizard/partner_balance_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard.py b/account_financial_report_webkit/wizard/partners_ledger_wizard.py index 48a33396..c8401485 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier diff --git a/account_financial_report_webkit/wizard/trial_balance_wizard.py b/account_financial_report_webkit/wizard/trial_balance_wizard.py index b34ce6c5..a4297e8e 100644 --- a/account_financial_report_webkit/wizard/trial_balance_wizard.py +++ b/account_financial_report_webkit/wizard/trial_balance_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier diff --git a/account_financial_report_webkit_xls/__init__.py b/account_financial_report_webkit_xls/__init__.py index 49db08a9..196ec38b 100644 --- a/account_financial_report_webkit_xls/__init__.py +++ b/account_financial_report_webkit_xls/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/__openerp__.py b/account_financial_report_webkit_xls/__openerp__.py index 666e336e..9064714e 100644 --- a/account_financial_report_webkit_xls/__openerp__.py +++ b/account_financial_report_webkit_xls/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/report/__init__.py b/account_financial_report_webkit_xls/report/__init__.py index f82c52fa..b767df50 100644 --- a/account_financial_report_webkit_xls/report/__init__.py +++ b/account_financial_report_webkit_xls/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/report/general_ledger_xls.py b/account_financial_report_webkit_xls/report/general_ledger_xls.py index 50ebe827..e9f263cd 100644 --- a/account_financial_report_webkit_xls/report/general_ledger_xls.py +++ b/account_financial_report_webkit_xls/report/general_ledger_xls.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/report/open_invoices_xls.py b/account_financial_report_webkit_xls/report/open_invoices_xls.py index db85c55f..fbd9805d 100644 --- a/account_financial_report_webkit_xls/report/open_invoices_xls.py +++ b/account_financial_report_webkit_xls/report/open_invoices_xls.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -260,8 +260,8 @@ class open_invoices_xls(report_xls): partner_name): if regroupmode == "regroup": c_specs = [('acc_title', self.nbr_columns, 0, 'text', - ' - '.join([account.code, account.name, partner_name - or _('No partner')])), ] + ' - '.join([account.code, account.name, partner_name or + _('No partner')])), ] else: c_specs = [ ('acc_title', self.nbr_columns, 0, 'text', ' - '. @@ -332,10 +332,10 @@ class open_invoices_xls(report_xls): else: c_specs += [('datedue', 1, 0, 'text', None)] c_specs += [ - ('debit', 1, 0, 'number', line.get('debit') - or 0.0, None, style_line_decimal), - ('credit', 1, 0, 'number', line.get('credit') - or 0.0, None, style_line_decimal), + ('debit', 1, 0, 'number', line.get('debit') or 0.0, + None, style_line_decimal), + ('credit', 1, 0, 'number', line.get('credit') or 0.0, + None, style_line_decimal), ] # determine the formula of the cumulated balance @@ -357,8 +357,9 @@ class open_invoices_xls(report_xls): if _p.amount_currency(data): if account.currency_id: c_specs += [ - ('curramount', 1, 0, 'number', line.get('amount_currency') - or 0.0, None, style_line_decimal), + ('curramount', 1, 0, 'number', + line.get('amount_currency') or 0.0, None, + style_line_decimal), ('currcode', 1, 0, 'text', line[ 'currency_code'], None, style_line_right), ] @@ -428,18 +429,18 @@ class open_invoices_xls(report_xls): else: c_specs += [('datedue', 1, 0, 'text', None)] c_specs += [ - ('debit', 1, 0, 'number', line.get('debit') - or 0.0, None, style_line_decimal), - ('credit', 1, 0, 'number', line.get('credit') - or 0.0, None, style_line_decimal), + ('debit', 1, 0, 'number', line.get('debit') or 0.0, None, + style_line_decimal), + ('credit', 1, 0, 'number', line.get('credit') or 0.0, None, + style_line_decimal), ('cumul', 1, 0, 'number', None, cumul_balance, style_line_decimal), ] if account.currency_id: c_specs += [ - ('curramount', 1, 0, 'number', line.get('amount_currency') - or 0.0, None, style_line_decimal), - ('currcode', 1, 0, 'text', line.get('currency_code') - or '', None, style_line_right), + ('curramount', 1, 0, 'number', line.get('amount_currency') or + 0.0, None, style_line_decimal), + ('currcode', 1, 0, 'text', line.get('currency_code') or '', + None, style_line_right), ] else: c_specs += [ diff --git a/account_financial_report_webkit_xls/report/partner_ledger_xls.py b/account_financial_report_webkit_xls/report/partner_ledger_xls.py index d1a7fe1f..3d3cfc9c 100644 --- a/account_financial_report_webkit_xls/report/partner_ledger_xls.py +++ b/account_financial_report_webkit_xls/report/partner_ledger_xls.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/report/partners_balance_xls.py b/account_financial_report_webkit_xls/report/partners_balance_xls.py index 8734812d..52378f99 100644 --- a/account_financial_report_webkit_xls/report/partners_balance_xls.py +++ b/account_financial_report_webkit_xls/report/partners_balance_xls.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -137,9 +137,10 @@ class partners_balance_xls(report_xls): ('c', 2, 0, 'text', _('Comparison') + str(index + 1) + ' (C' + str(index + 1) + ')')] if params['comparison_filter'] == 'filter_date': - c_specs += [('f', 2, 0, 'text', _('Dates Filter') + ': ' + - _p.formatLang(params['start'], date=True) + ' - ' - + _p.formatLang(params['stop'], date=True))] + c_specs += [ + ('f', 2, 0, 'text', _('Dates Filter') + ': ' + + _p.formatLang(params['start'], date=True) + ' - ' + + _p.formatLang(params['stop'], date=True))] elif params['comparison_filter'] == 'filter_period': c_specs += [('f', 2, 0, 'text', _('Periods Filter') + ': ' + params['start'].name + ' - ' + diff --git a/account_financial_report_webkit_xls/report/trial_balance_xls.py b/account_financial_report_webkit_xls/report/trial_balance_xls.py index 27f08ec4..e50fae07 100644 --- a/account_financial_report_webkit_xls/report/trial_balance_xls.py +++ b/account_financial_report_webkit_xls/report/trial_balance_xls.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -304,8 +304,9 @@ class trial_balance_xls(report_xls): ('diff', 1, 0, 'number', comp_account[ 'diff'], None, cell_style_decimal), ('diff_percent', 1, 0, 'number', comp_account[ - 'percent_diff'] and comp_account['percent_diff'] - or 0, None, cell_style_pct), + 'percent_diff'] and + comp_account['percent_diff'] or 0, + None, cell_style_pct), ] c_specs += [('type', 1, 0, 'text', diff --git a/account_financial_report_webkit_xls/wizard/__init__.py b/account_financial_report_webkit_xls/wizard/__init__.py index 7de0a818..55e116d4 100644 --- a/account_financial_report_webkit_xls/wizard/__init__.py +++ b/account_financial_report_webkit_xls/wizard/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py b/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py index 99ab9d07..dc1a0884 100644 --- a/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py +++ b/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py b/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py index dcc339c4..332337b2 100644 --- a/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py +++ b/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py b/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py index 27fc1ae7..96a45a8e 100644 --- a/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py +++ b/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py index 27057c6d..aad5be86 100644 --- a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py b/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py index 7f4ecd41..bd845d32 100644 --- a/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py +++ b/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/__init__.py b/account_journal_report_xls/__init__.py index 6368e57d..78adb3ed 100644 --- a/account_journal_report_xls/__init__.py +++ b/account_journal_report_xls/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/__openerp__.py b/account_journal_report_xls/__openerp__.py index 47987990..3afbc193 100644 --- a/account_journal_report_xls/__openerp__.py +++ b/account_journal_report_xls/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/account_journal.py b/account_journal_report_xls/account_journal.py index e426ec9d..fe176287 100644 --- a/account_journal_report_xls/account_journal.py +++ b/account_journal_report_xls/account_journal.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/report/__init__.py b/account_journal_report_xls/report/__init__.py index 91ffb7bf..6b995464 100644 --- a/account_journal_report_xls/report/__init__.py +++ b/account_journal_report_xls/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/report/nov_account_journal.py b/account_journal_report_xls/report/nov_account_journal.py index 18b7347b..04491d22 100644 --- a/account_journal_report_xls/report/nov_account_journal.py +++ b/account_journal_report_xls/report/nov_account_journal.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -166,8 +166,8 @@ class nov_journal_print(report_sxw.rml_parse): "rc.symbol AS currency_symbol, " "coalesce(ai.internal_number,'-') AS inv_number, " "coalesce(abs.name,'-') AS st_number, " - "coalesce(av.number,'-') AS voucher_number " - + select_extra + + "coalesce(av.number,'-') AS voucher_number " + + select_extra + "FROM account_move_line l " "INNER JOIN account_move am ON l.move_id = am.id " "INNER JOIN account_account aa " @@ -192,11 +192,11 @@ class nov_journal_print(report_sxw.rml_parse): "LEFT OUTER JOIN account_analytic_account ana " "ON l.analytic_account_id = ana.id " "LEFT OUTER JOIN res_currency rc " - "ON l.currency_id = rc.id " - + join_extra + + "ON l.currency_id = rc.id " + + join_extra + "WHERE l.period_id IN %s AND l.journal_id = %s " - "AND am.state IN %s " - + where_extra + + "AND am.state IN %s " + + where_extra + "ORDER BY " + self.sort_selection + ", move_date, move_id, acc_code", (tuple(period_ids), journal_id, @@ -206,12 +206,12 @@ class nov_journal_print(report_sxw.rml_parse): # add reference of corresponding origin document if journal.type in ('sale', 'sale_refund', 'purchase', 'purchase_refund'): - [x.update({'docname': (_('Invoice') + ': ' + x['inv_number']) - or (_('Voucher') + ': ' + x['voucher_number']) or '-'}) + [x.update({'docname': (_('Invoice') + ': ' + x['inv_number']) or + (_('Voucher') + ': ' + x['voucher_number']) or '-'}) for x in lines] elif journal.type in ('bank', 'cash'): - [x.update({'docname': (_('Statement') + ': ' + x['st_number']) - or (_('Voucher') + ': ' + x['voucher_number']) or '-'}) + [x.update({'docname': (_('Statement') + ': ' + x['st_number']) or + (_('Voucher') + ': ' + x['voucher_number']) or '-'}) for x in lines] else: code_string = j_obj._report_xls_document_extra( diff --git a/account_journal_report_xls/report/nov_account_journal_xls.py b/account_journal_report_xls/report/nov_account_journal_xls.py index e2d68631..c8b77f8c 100644 --- a/account_journal_report_xls/report/nov_account_journal_xls.py +++ b/account_journal_report_xls/report/nov_account_journal_xls.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/wizard/__init__.py b/account_journal_report_xls/wizard/__init__.py index 406a7a8f..604f3299 100644 --- a/account_journal_report_xls/wizard/__init__.py +++ b/account_journal_report_xls/wizard/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_journal_report_xls/wizard/print_journal_wizard.py b/account_journal_report_xls/wizard/print_journal_wizard.py index 14cb3621..c35b7d89 100644 --- a/account_journal_report_xls/wizard/print_journal_wizard.py +++ b/account_journal_report_xls/wizard/print_journal_wizard.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_partner_aged_statement_webkit/__init__.py b/account_partner_aged_statement_webkit/__init__.py index 0d4d7acc..40e00a83 100644 --- a/account_partner_aged_statement_webkit/__init__.py +++ b/account_partner_aged_statement_webkit/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_partner_aged_statement_webkit/__openerp__.py b/account_partner_aged_statement_webkit/__openerp__.py index acbb8d47..aa927cea 100644 --- a/account_partner_aged_statement_webkit/__openerp__.py +++ b/account_partner_aged_statement_webkit/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution @@ -23,7 +23,8 @@ { 'name': 'Partner Aged Statement', "version": "1.0", - 'author': 'Savoir-faire Linux', + 'author': 'Savoir-faire Linux, ' + 'Odoo Community Association (OCA)', 'website': 'http://www.savoirfairelinux.com', 'depends': [ 'report_webkit', @@ -31,6 +32,7 @@ 'mail', 'account', ], + 'license': 'AGPL-3', 'category': 'Accounting', 'description': """ Print & Send Partner Aged Statement by email diff --git a/account_partner_aged_statement_webkit/partner_aged_statement.py b/account_partner_aged_statement_webkit/partner_aged_statement.py index 00a0e577..a1b2118e 100644 --- a/account_partner_aged_statement_webkit/partner_aged_statement.py +++ b/account_partner_aged_statement_webkit/partner_aged_statement.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution diff --git a/account_partner_aged_statement_webkit/report/__init__.py b/account_partner_aged_statement_webkit/report/__init__.py index 79e67fbf..1fccd05a 100644 --- a/account_partner_aged_statement_webkit/report/__init__.py +++ b/account_partner_aged_statement_webkit/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_partner_aged_statement_webkit/report/partner_aged_statement_report.py b/account_partner_aged_statement_webkit/report/partner_aged_statement_report.py index 863f4145..d3e94047 100644 --- a/account_partner_aged_statement_webkit/report/partner_aged_statement_report.py +++ b/account_partner_aged_statement_webkit/report/partner_aged_statement_report.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution @@ -199,8 +199,6 @@ class PartnerAgedTrialReport(aged_trial_report): line['date_original'] >= stop ) and line['type'] in ['in_invoice', 'out_invoice']) ] - - print movelines return movelines def _lines_get_31_60(self, partner, company): diff --git a/account_partner_aged_statement_webkit/report/supplier_aged_statement_report.py b/account_partner_aged_statement_webkit/report/supplier_aged_statement_report.py index 3a6d73c7..f24ebe10 100644 --- a/account_partner_aged_statement_webkit/report/supplier_aged_statement_report.py +++ b/account_partner_aged_statement_webkit/report/supplier_aged_statement_report.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution diff --git a/account_partner_aged_statement_webkit/tests/test_aged_statement.py b/account_partner_aged_statement_webkit/tests/test_aged_statement.py index fe742cb4..b0948fe9 100644 --- a/account_partner_aged_statement_webkit/tests/test_aged_statement.py +++ b/account_partner_aged_statement_webkit/tests/test_aged_statement.py @@ -1,4 +1,4 @@ -# -*- coding:utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Savoir-faire Linux. All Rights Reserved.