From 8ce2b82351e747d803c89cef12c6473ad97b4064 Mon Sep 17 00:00:00 2001 From: "laetitia.gangloff@acsone.eu" Date: Fri, 8 Aug 2014 11:48:27 +0200 Subject: [PATCH] [pep8] - review on account_export_csv, account_move_line_report_xls, account_journal_report_xls, account_financial_report_horizontal, account_financial_report_webkit_xls --- account_export_csv/__init__.py | 2 +- account_export_csv/__openerp__.py | 4 +- account_export_csv/wizard/__init__.py | 2 +- .../wizard/account_export_csv.py | 5 +- .../__init__.py | 4 +- .../report/__init__.py | 4 +- .../report/account_balance_sheet.py | 8 +-- .../report/account_profit_loss.py | 8 +-- .../report/common_report_header.py | 25 +++++----- .../wizard/__init__.py | 8 +-- .../wizard/account_report_balance_sheet.py | 2 +- .../wizard/account_report_common.py | 4 +- .../wizard/account_report_common_account.py | 2 +- .../wizard/account_report_profit_loss.py | 2 +- .../__openerp__.py | 5 +- .../report/__init__.py | 2 - .../report/general_ledger_xls.py | 8 +-- .../report/open_invoices_xls.py | 50 +++++++++---------- .../report/partner_ledger_xls.py | 11 ++-- .../report/partners_balance_xls.py | 9 ++-- .../report/trial_balance_xls.py | 6 +-- .../wizard/general_ledger_wizard.py | 4 +- .../wizard/open_invoices_wizard.py | 4 +- .../wizard/partners_balance_wizard.py | 4 +- .../wizard/partners_ledger_wizard.py | 4 +- .../wizard/trial_balance_wizard.py | 4 +- account_journal_report_xls/__init__.py | 2 - account_journal_report_xls/__openerp__.py | 2 - account_journal_report_xls/report/__init__.py | 6 +-- .../report/nov_account_journal.py | 6 +-- .../report/nov_account_journal_xls.py | 12 +++-- account_journal_report_xls/wizard/__init__.py | 2 - .../wizard/print_journal_wizard.py | 6 +-- .../report/move_line_list_xls.py | 11 ++-- 34 files changed, 107 insertions(+), 131 deletions(-) diff --git a/account_export_csv/__init__.py b/account_export_csv/__init__.py index a332e0c2..3d455ad0 100644 --- a/account_export_csv/__init__.py +++ b/account_export_csv/__init__.py @@ -19,4 +19,4 @@ # ############################################################################## -import wizard +from . import wizard diff --git a/account_export_csv/__openerp__.py b/account_export_csv/__openerp__.py index 498db950..3c432f5d 100644 --- a/account_export_csv/__openerp__.py +++ b/account_export_csv/__openerp__.py @@ -29,7 +29,7 @@ 'description': """ Add a wizard that allow you to export a csv file based on accounting -journal entries + journal entries - Trial Balance - Analytic Balance (with accounts) @@ -38,7 +38,7 @@ journal entries You can filter by period TODO: rearange wizard view with only one button to generate file plus -define a selection list to select report type + define a selection list to select report type """, 'website': 'http://www.camptocamp.com', 'data': [ diff --git a/account_export_csv/wizard/__init__.py b/account_export_csv/wizard/__init__.py index 453b4a2d..a7104216 100644 --- a/account_export_csv/wizard/__init__.py +++ b/account_export_csv/wizard/__init__.py @@ -19,4 +19,4 @@ # ############################################################################## -import account_export_csv +from . import account_export_csv diff --git a/account_export_csv/wizard/account_export_csv.py b/account_export_csv/wizard/account_export_csv.py index 1f78470b..7fb4e080 100644 --- a/account_export_csv/wizard/account_export_csv.py +++ b/account_export_csv/wizard/account_export_csv.py @@ -215,8 +215,8 @@ class AccountCSVExport(orm.TransientModel): Return list to generate rows of the CSV file """ cr.execute(""" select aac.code as analytic_code, - aac.name as analytic_name, - ac.code,ac.name, + aac.name as analytic_name, + ac.code,ac.name, sum(debit) as sum_debit, sum(credit) as sum_credit, sum(debit) - sum(credit) as balance @@ -333,7 +333,6 @@ class AccountCSVExport(orm.TransientModel): account_move_reconcile.name as full_reconcile, account_move_line.reconcile_partial_id AS partial_reconcile_id, account_analytic_account.code AS analytic_account_code, - account_move.name AS entry_number, account_account.name AS account_name, account_move_line.debit - account_move_line.credit AS balance, diff --git a/account_financial_report_horizontal/__init__.py b/account_financial_report_horizontal/__init__.py index 6fbe4f54..c4e388b7 100644 --- a/account_financial_report_horizontal/__init__.py +++ b/account_financial_report_horizontal/__init__.py @@ -1,2 +1,2 @@ -import report -import wizard +from . import report +from . import wizard diff --git a/account_financial_report_horizontal/report/__init__.py b/account_financial_report_horizontal/report/__init__.py index 84f8b2a5..cd67a22f 100644 --- a/account_financial_report_horizontal/report/__init__.py +++ b/account_financial_report_horizontal/report/__init__.py @@ -1,3 +1,3 @@ # import account_balance -import account_balance_sheet -import account_profit_loss +from . import account_balance_sheet +from . import account_profit_loss diff --git a/account_financial_report_horizontal/report/account_balance_sheet.py b/account_financial_report_horizontal/report/account_balance_sheet.py index bbd6b007..83930932 100644 --- a/account_financial_report_horizontal/report/account_balance_sheet.py +++ b/account_financial_report_horizontal/report/account_balance_sheet.py @@ -24,7 +24,6 @@ import time -import openerp.pooler as pooler from openerp.report import report_sxw from openerp.addons.account_financial_report_horizontal.report import ( account_profit_loss @@ -97,14 +96,13 @@ class report_balancesheet_horizontal( def get_data(self, data): cr, uid = self.cr, self.uid - db_pool = pooler.get_pool(self.cr.dbname) # Getting Profit or Loss Balance from profit and Loss report self.obj_pl.get_data(data) self.res_bl = self.obj_pl.final_result() - account_pool = db_pool.get('account.account') - currency_pool = db_pool.get('res.currency') + account_pool = self.pool['account.account'] + currency_pool = self.pool['res.currency'] types = [ 'liability', @@ -276,5 +274,3 @@ report_sxw.report_sxw( 'account_balance_sheet.rml', parser=report_balancesheet_horizontal, header='internal') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_financial_report_horizontal/report/account_profit_loss.py b/account_financial_report_horizontal/report/account_profit_loss.py index 66611964..dca8028d 100644 --- a/account_financial_report_horizontal/report/account_profit_loss.py +++ b/account_financial_report_horizontal/report/account_profit_loss.py @@ -22,7 +22,6 @@ ############################################################################## import time -import openerp.pooler as pooler from openerp.report import report_sxw from common_report_header import common_report_header from openerp.tools.translate import _ @@ -101,10 +100,9 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): } cr, uid = self.cr, self.uid - db_pool = pooler.get_pool(self.cr.dbname) - account_pool = db_pool.get('account.account') - currency_pool = db_pool.get('res.currency') + account_pool = self.pool['account.account'] + currency_pool = self.pool['res.currency'] types = [ 'expense', @@ -247,5 +245,3 @@ report_sxw.report_sxw( 'addons/account_financial_report_horizontal/report/' 'account_profit_loss.rml', parser=report_pl_account_horizontal, header='internal') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_financial_report_horizontal/report/common_report_header.py b/account_financial_report_horizontal/report/common_report_header.py index ed7e06f3..a30a9e6a 100644 --- a/account_financial_report_horizontal/report/common_report_header.py +++ b/account_financial_report_horizontal/report/common_report_header.py @@ -19,7 +19,6 @@ # ############################################################################## -import openerp.pooler as pooler from openerp.tools.translate import _ @@ -44,25 +43,25 @@ class common_report_header(object): def get_start_period(self, data): if data.get('form', False) and data['form'].get('period_from', False): - return pooler.get_pool(self.cr.dbname).get( - 'account.period').browse(self.cr, self.uid, data[ - 'form']['period_from'][0]).name + return self.pool['account.period'].browse( + self.cr, self.uid, + data['form']['period_from'][0]).name return '' def get_end_period(self, data): if data.get('form', False) and data['form'].get('period_to', False): - return pooler.get_pool(self.cr.dbname).get( - 'account.period').browse(self.cr, self.uid, data[ - 'form']['period_to'][0]).name + return self.pool['account.period'].browse( + self.cr, self.uid, + data['form']['period_to'][0]).name return '' def _get_account(self, data): if data.get('form', False) and data['form'].get( 'chart_account_id', False ): - return pooler.get_pool(self.cr.dbname).get( - 'account.account').browse(self.cr, self.uid, data[ - 'form']['chart_account_id'][0]).name + return self.pool['account.account'].browse( + self.cr, self.uid, + data['form']['chart_account_id'][0]).name return '' def _get_sortby(self, data): @@ -80,7 +79,7 @@ class common_report_header(object): if data.get('form', False) and data['form'].get( 'fiscalyear_id', False ): - return pooler.get_pool(self.cr.dbname).get( - 'account.fiscalyear').browse(self.cr, self.uid, data[ - 'form']['fiscalyear_id'][0]).name + return self.pool['account.fiscalyear'].browse( + self.cr, self.uid, + data['form']['fiscalyear_id'][0]).name return '' diff --git a/account_financial_report_horizontal/wizard/__init__.py b/account_financial_report_horizontal/wizard/__init__.py index ec82d67c..430bf2a4 100644 --- a/account_financial_report_horizontal/wizard/__init__.py +++ b/account_financial_report_horizontal/wizard/__init__.py @@ -1,4 +1,4 @@ -import account_report_common -import account_report_common_account -import account_report_balance_sheet -import account_report_profit_loss +from . import account_report_common +from . import account_report_common_account +from . import account_report_balance_sheet +from . import account_report_profit_loss diff --git a/account_financial_report_horizontal/wizard/account_report_balance_sheet.py b/account_financial_report_horizontal/wizard/account_report_balance_sheet.py index a46f2d45..9fa5d1e9 100644 --- a/account_financial_report_horizontal/wizard/account_report_balance_sheet.py +++ b/account_financial_report_horizontal/wizard/account_report_balance_sheet.py @@ -21,7 +21,7 @@ # ############################################################################## -from osv import orm, fields +from openerp.osv import orm, fields class account_bs_report(orm.TransientModel): diff --git a/account_financial_report_horizontal/wizard/account_report_common.py b/account_financial_report_horizontal/wizard/account_report_common.py index 2535e0fe..d0173773 100644 --- a/account_financial_report_horizontal/wizard/account_report_common.py +++ b/account_financial_report_horizontal/wizard/account_report_common.py @@ -24,8 +24,8 @@ import time from lxml import etree -from osv import fields, orm -from tools.translate import _ +from openerp.osv import fields, orm +from openerp.tools.translate import _ class account_common_report(orm.TransientModel): diff --git a/account_financial_report_horizontal/wizard/account_report_common_account.py b/account_financial_report_horizontal/wizard/account_report_common_account.py index 0e531974..50376c48 100644 --- a/account_financial_report_horizontal/wizard/account_report_common_account.py +++ b/account_financial_report_horizontal/wizard/account_report_common_account.py @@ -21,7 +21,7 @@ # ############################################################################## -from osv import orm, fields +from openerp.osv import orm, fields class account_common_account_report(orm.TransientModel): diff --git a/account_financial_report_horizontal/wizard/account_report_profit_loss.py b/account_financial_report_horizontal/wizard/account_report_profit_loss.py index 5ba47b30..8f2b7033 100644 --- a/account_financial_report_horizontal/wizard/account_report_profit_loss.py +++ b/account_financial_report_horizontal/wizard/account_report_profit_loss.py @@ -21,7 +21,7 @@ # ############################################################################## -from osv import orm, fields +from openerp.osv import orm, fields class account_pl_report(orm.TransientModel): diff --git a/account_financial_report_webkit_xls/__openerp__.py b/account_financial_report_webkit_xls/__openerp__.py index 775b35aa..6c2235b3 100644 --- a/account_financial_report_webkit_xls/__openerp__.py +++ b/account_financial_report_webkit_xls/__openerp__.py @@ -36,9 +36,8 @@ """, 'depends': ['report_xls', 'account_financial_report_webkit'], - 'demo_xml': [], - 'init_xml': [], - 'update_xml': [ + 'demo': [], + 'data': [ 'wizard/general_ledger_wizard_view.xml', 'wizard/trial_balance_wizard_view.xml', 'wizard/partners_ledger_wizard_view.xml', diff --git a/account_financial_report_webkit_xls/report/__init__.py b/account_financial_report_webkit_xls/report/__init__.py index 359e3a33..f82c52fa 100644 --- a/account_financial_report_webkit_xls/report/__init__.py +++ b/account_financial_report_webkit_xls/report/__init__.py @@ -25,5 +25,3 @@ from . import trial_balance_xls from . import partners_balance_xls from . import partner_ledger_xls from . import open_invoices_xls - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 c1a6f0ea..d48b1a76 100644 --- a/account_financial_report_webkit_xls/report/general_ledger_xls.py +++ b/account_financial_report_webkit_xls/report/general_ledger_xls.py @@ -27,8 +27,8 @@ from openerp.addons.report_xls.utils import rowcol_to_cell from openerp.addons.account_financial_report_webkit.report.general_ledger\ import GeneralLedgerWebkit from openerp.tools.translate import _ -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) _column_sizes = [ ('date', 12), @@ -146,7 +146,8 @@ class general_ledger_xls(report_xls): c_hdr_cell_style = xlwt.easyxf(cell_format) c_hdr_cell_style_right = xlwt.easyxf(cell_format + _xs['right']) c_hdr_cell_style_center = xlwt.easyxf(cell_format + _xs['center']) - c_hdr_cell_style_decimal = xlwt.easyxf(cell_format + _xs['right'], + c_hdr_cell_style_decimal = xlwt.easyxf( + cell_format + _xs['right'], num_format_str=report_xls.decimal_format) # Column Initial Balance Row @@ -350,4 +351,3 @@ class general_ledger_xls(report_xls): general_ledger_xls('report.account.account_report_general_ledger_xls', 'account.account', parser=GeneralLedgerWebkit) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 f3b64f11..c5ae72bf 100644 --- a/account_financial_report_webkit_xls/report/open_invoices_xls.py +++ b/account_financial_report_webkit_xls/report/open_invoices_xls.py @@ -27,8 +27,8 @@ from openerp.addons.report_xls.utils import rowcol_to_cell from openerp.addons.account_financial_report_webkit.report.open_invoices\ import PartnersOpenInvoicesWebkit from openerp.tools.translate import _ -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class open_invoices_xls(report_xls): @@ -45,7 +45,7 @@ class open_invoices_xls(report_xls): ws.fit_width_to_pages = 1 ws.header_str = self.xls_headers['standard'] ws.footer_str = self.xls_footers['standard'] - #------------------------------------------------------- + # ------------------------------------------------------- # number of columns is 11 in case of normal report, 13 in case the # option currency is selected and 12 in case of the regroup by currency # option is checked @@ -62,90 +62,90 @@ class open_invoices_xls(report_xls): nbr_columns = 13 else: nbr_columns = 11 - #------------------------------------------------------- + # ------------------------------------------------------- global style_font12 # cell style for report title style_font12 = xlwt.easyxf(_xs['xls_title']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_default style_default = xlwt.easyxf(_xs['borders_all']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_default_italic style_default_italic = xlwt.easyxf(_xs['borders_all'] + _xs['italic']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_bold style_bold = xlwt.easyxf(_xs['bold'] + _xs['borders_all']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_bold_center style_bold_center = xlwt.easyxf( _xs['bold'] + _xs['borders_all'] + _xs['center']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_bold_italic style_bold_italic = xlwt.easyxf( _xs['bold'] + _xs['borders_all'] + _xs['italic']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_bold_italic_decimal style_bold_italic_decimal = xlwt.easyxf( _xs['bold'] + _xs['borders_all'] + _xs['italic'] + _xs['right'], num_format_str=report_xls.decimal_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_bold_blue style_bold_blue = xlwt.easyxf( _xs['bold'] + _xs['fill_blue'] + _xs['borders_all']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_bold_blue_italic_decimal style_bold_blue_italic_decimal = xlwt.easyxf( _xs['bold'] + _xs['fill_blue'] + _xs['borders_all'] + _xs['italic'], num_format_str=report_xls.decimal_format) - #------------------------------------------------------- + # ------------------------------------------------------- # cell style for header titles: 'Chart of accounts' - 'Fiscal year' ... global style_bold_blue_center style_bold_blue_center = xlwt.easyxf( _xs['bold'] + _xs['fill_blue'] + _xs['borders_all'] + _xs['center']) - #------------------------------------------------------- + # ------------------------------------------------------- # cell style for header data: 'Chart of accounts' - 'Fiscal year' ... global style_center style_center = xlwt.easyxf( _xs['borders_all'] + _xs['wrap'] + _xs['center']) - #------------------------------------------------------- + # ------------------------------------------------------- # cell style for columns titles 'Date'- 'Period' - 'Entry'... global style_yellow_bold style_yellow_bold = xlwt.easyxf( _xs['bold'] + _xs['fill'] + _xs['borders_all']) - #------------------------------------------------------- + # ------------------------------------------------------- # cell style for columns titles 'Date'- 'Period' - 'Entry'... global style_yellow_bold_right style_yellow_bold_right = xlwt.easyxf( _xs['bold'] + _xs['fill'] + _xs['borders_all'] + _xs['right']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_right style_right = xlwt.easyxf(_xs['borders_all'] + _xs['right']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_right_italic style_right_italic = xlwt.easyxf( _xs['borders_all'] + _xs['right'] + _xs['italic']) - #------------------------------------------------------- + # ------------------------------------------------------- global style_decimal style_decimal = xlwt.easyxf( _xs['borders_all'] + _xs['right'], num_format_str=report_xls.decimal_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_decimal_italic style_decimal_italic = xlwt.easyxf( _xs['borders_all'] + _xs['right'] + _xs['italic'], num_format_str=report_xls.decimal_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_date style_date = xlwt.easyxf( _xs['borders_all'] + _xs['left'], num_format_str=report_xls.date_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_date_italic style_date_italic = xlwt.easyxf( _xs['borders_all'] + _xs['left'] + _xs['italic'], num_format_str=report_xls.date_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_account_title, style_account_title_right,\ style_account_title_decimal cell_format = _xs['xls_title'] + _xs['bold'] + \ @@ -155,11 +155,11 @@ class open_invoices_xls(report_xls): style_account_title_decimal = xlwt.easyxf( cell_format + _xs['right'], num_format_str=report_xls.decimal_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_partner_row cell_format = _xs['bold'] style_partner_row = xlwt.easyxf(cell_format) - #------------------------------------------------------- + # ------------------------------------------------------- global style_partner_cumul, style_partner_cumul_right,\ style_partner_cumul_center, style_partner_cumul_decimal cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all'] 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 dd0d3646..f349b8e8 100644 --- a/account_financial_report_webkit_xls/report/partner_ledger_xls.py +++ b/account_financial_report_webkit_xls/report/partner_ledger_xls.py @@ -27,8 +27,8 @@ from openerp.addons.report_xls.utils import rowcol_to_cell from openerp.addons.account_financial_report_webkit.report.partners_ledger\ import PartnersLedgerWebkit from openerp.tools.translate import _ -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) _column_sizes = [ ('date', 12), @@ -331,7 +331,7 @@ class partner_ledger_xls(report_xls): debit_cell = rowcol_to_cell(row_pos, 7) credit_cell = rowcol_to_cell(row_pos, 8) cumbal_formula += debit_cell + '-' + credit_cell - ################## Print row ledger line data ######### + # Print row ledger line data # if line.get('ldate'): c_specs = [ @@ -376,7 +376,7 @@ class partner_ledger_xls(report_xls): ws, row_pos, row_data, ll_cell_style) # end for line - ################## Print row Cumulated Balance by partner # + # Print row Cumulated Balance by partner # debit_partner_start = rowcol_to_cell(row_start_partner, 7) debit_partner_end = rowcol_to_cell(row_pos - 1, 7) debit_partner_total = 'SUM(' + debit_partner_start + \ @@ -427,7 +427,7 @@ class partner_ledger_xls(report_xls): account_balance_cumul += cumul_balance account_balance_cumul_curr += cumul_balance_curr - ################## Print row Cumulated Balance by account ##### + # Print row Cumulated Balance by account # c_specs = [ ('acc_title', 5, 0, 'text', ' - '. join([account.code, account.name])), ] @@ -462,4 +462,3 @@ class partner_ledger_xls(report_xls): partner_ledger_xls('report.account.account_report_partner_ledger_xls', 'account.account', parser=PartnersLedgerWebkit) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 4316aea2..3eae472c 100644 --- a/account_financial_report_webkit_xls/report/partners_balance_xls.py +++ b/account_financial_report_webkit_xls/report/partners_balance_xls.py @@ -26,8 +26,8 @@ from openerp.addons.report_xls.utils import rowcol_to_cell from openerp.addons.account_financial_report_webkit.report.partner_balance\ import PartnerBalanceWebkit from openerp.tools.translate import _ -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) def display_line(all_comparison_lines): @@ -295,7 +295,8 @@ class partners_balance_xls(report_xls): regular_cell_style_center = xlwt.easyxf( regular_cell_format + _xs['center']) regular_cell_style_decimal = xlwt.easyxf( - regular_cell_format + _xs['right'], num_format_str=report_xls.decimal_format) + regular_cell_format + _xs['right'], + num_format_str=report_xls.decimal_format) regular_cell_style_pct = xlwt.easyxf( regular_cell_format + _xs['center'], num_format_str='0') @@ -427,5 +428,3 @@ class partners_balance_xls(report_xls): partners_balance_xls('report.account.account_report_partner_balance_xls', 'account.account', parser=PartnerBalanceWebkit) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 b2f13fdf..5bd20508 100644 --- a/account_financial_report_webkit_xls/report/trial_balance_xls.py +++ b/account_financial_report_webkit_xls/report/trial_balance_xls.py @@ -26,8 +26,8 @@ from openerp.addons.report_xls.utils import rowcol_to_cell from openerp.addons.account_financial_report_webkit.report.trial_balance\ import TrialBalanceWebkit from openerp.tools.translate import _ -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class trial_balance_xls(report_xls): @@ -325,5 +325,3 @@ class trial_balance_xls(report_xls): trial_balance_xls('report.account.account_report_trial_balance_xls', 'account.account', parser=TrialBalanceWebkit) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 7480e445..99ab9d07 100644 --- a/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py +++ b/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py @@ -21,8 +21,8 @@ ############################################################################## from openerp.osv import orm -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class general_ledger_webkit_wizard(orm.TransientModel): 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 b217e5ee..dcc339c4 100644 --- a/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py +++ b/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py @@ -21,8 +21,8 @@ ############################################################################## from openerp.osv import orm -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class open_invoices_webkit_wizard(orm.TransientModel): 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 8d9024d8..27fc1ae7 100644 --- a/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py +++ b/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py @@ -21,8 +21,8 @@ ############################################################################## from openerp.osv import orm -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class partner_balance_wizard(orm.TransientModel): 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 008c10c6..27057c6d 100644 --- a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py @@ -21,8 +21,8 @@ ############################################################################## from openerp.osv import orm -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class partner_ledger_webkit_wizard(orm.TransientModel): 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 0d800917..7f4ecd41 100644 --- a/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py +++ b/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py @@ -21,8 +21,8 @@ ############################################################################## from openerp.osv import orm -#import logging -#_logger = logging.getLogger(__name__) +# import logging +# _logger = logging.getLogger(__name__) class trial_balance_wizard(orm.TransientModel): diff --git a/account_journal_report_xls/__init__.py b/account_journal_report_xls/__init__.py index e4585aee..6368e57d 100644 --- a/account_journal_report_xls/__init__.py +++ b/account_journal_report_xls/__init__.py @@ -28,5 +28,3 @@ except ImportError: import logging logging.getLogger('openerp.module').warning('''report_xls not available in addons path. account_financial_report_webkit_xls will not be usable''') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_journal_report_xls/__openerp__.py b/account_journal_report_xls/__openerp__.py index 9f7cce5d..cac29015 100644 --- a/account_journal_report_xls/__openerp__.py +++ b/account_journal_report_xls/__openerp__.py @@ -52,5 +52,3 @@ cf. https://launchpad.net/openerp-reporting-engines 'wizard/print_journal_wizard.xml', ], } - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_journal_report_xls/report/__init__.py b/account_journal_report_xls/report/__init__.py index 100df303..91ffb7bf 100644 --- a/account_journal_report_xls/report/__init__.py +++ b/account_journal_report_xls/report/__init__.py @@ -20,7 +20,5 @@ # ############################################################################## -import nov_account_journal -import nov_account_journal_xls - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +from . import nov_account_journal +from . import nov_account_journal_xls diff --git a/account_journal_report_xls/report/nov_account_journal.py b/account_journal_report_xls/report/nov_account_journal.py index 8dad4fc7..ca891718 100644 --- a/account_journal_report_xls/report/nov_account_journal.py +++ b/account_journal_report_xls/report/nov_account_journal.py @@ -216,7 +216,7 @@ class nov_journal_print(report_sxw.rml_parse): else: code_string = j_obj._report_xls_document_extra( self.cr, self.uid, self.context) - #_logger.warn('code_string= %s', code_string) + # _logger.warn('code_string= %s', code_string) [x.update({'docname': eval(code_string) or '-'}) for x in lines] # group lines @@ -261,7 +261,7 @@ class nov_journal_print(report_sxw.rml_parse): key = (line['account_id'], line['tax_code_id'], line['partner_id']) - if not key in lines_grouped: + if key not in lines_grouped: lines_grouped[key] = line else: lines_grouped[key]['debit'] += line['debit'] @@ -358,5 +358,3 @@ report_sxw.report_sxw( 'report.nov.account.journal.print', 'account.journal', 'addons/account_journal_report_xls/report/nov_account_journal.rml', parser=nov_journal_print, header=False) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 e7f07f2d..b9206efa 100644 --- a/account_journal_report_xls/report/nov_account_journal_xls.py +++ b/account_journal_report_xls/report/nov_account_journal_xls.py @@ -86,7 +86,8 @@ class account_journal_xls(report_xls): 'header': [1, 20, 'text', _render("_('Entry')")], 'lines': [1, 0, 'text', - _render("l['move_name'] != '/' and l['move_name'] or ('*'+str(l['move_id']))")], + _render("l['move_name'] != '/' and l['move_name']\ + or ('*'+str(l['move_id']))")], 'totals': [1, 0, 'text', None]}, 'move_date': { 'header': [1, 13, 'text', _render("_('Date')")], @@ -141,7 +142,8 @@ class account_journal_xls(report_xls): [1, 0, _render("l['date_maturity'] and 'date' or 'text'"), _render( - "l['date_maturity'] and datetime.strptime(l['date_maturity'],'%Y-%m-%d') or None"), + "l['date_maturity'] and datetime.\ + strptime(l['date_maturity'],'%Y-%m-%d') or None"), None, self.aml_cell_style_date], 'totals': [1, 0, 'text', None]}, 'debit': { @@ -374,7 +376,9 @@ class account_journal_xls(report_xls): if not (self.credit_pos and self.debit_pos) and 'balance'\ in wanted_list: raise orm.except_orm(_('Customisation Error!'), - _("The 'Balance' field is a calculated XLS field requiring the presence of the 'Debit' and 'Credit' fields !")) + _("The 'Balance' field is a calculated XLS\ + field requiring the presence of the\ + 'Debit' and 'Credit' fields !")) for o in objects: @@ -399,5 +403,3 @@ class account_journal_xls(report_xls): account_journal_xls('report.nov.account.journal.xls', 'account.journal.period', parser=account_journal_xls_parser) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_journal_report_xls/wizard/__init__.py b/account_journal_report_xls/wizard/__init__.py index 2e90d13a..406a7a8f 100644 --- a/account_journal_report_xls/wizard/__init__.py +++ b/account_journal_report_xls/wizard/__init__.py @@ -21,5 +21,3 @@ ############################################################################## from . import print_journal_wizard - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_journal_report_xls/wizard/print_journal_wizard.py b/account_journal_report_xls/wizard/print_journal_wizard.py index 81d415ec..42eece8e 100644 --- a/account_journal_report_xls/wizard/print_journal_wizard.py +++ b/account_journal_report_xls/wizard/print_journal_wizard.py @@ -114,7 +114,9 @@ class account_print_journal_xls(orm.TransientModel): FROM account_period ap WHERE ap.date_start>=%s AND ap.date_stop<=%s AND company_id=%s ORDER BY date_start, special DESC""", - (period_from.date_start, period_to.date_stop, company_id)) + (period_from.date_start, + period_to.date_stop, + company_id)) wiz_period_ids = map(lambda x: x[0], cr.fetchall()) wiz_journal_ids = [j.id for j in wiz_form.journal_ids] @@ -190,5 +192,3 @@ class account_print_journal_xls(orm.TransientModel): 'type': 'ir.actions.report.xml', 'report_name': 'nov.account.journal.print', 'datas': datas} - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_move_line_report_xls/report/move_line_list_xls.py b/account_move_line_report_xls/report/move_line_list_xls.py index 6c1f0f3f..23c25c6a 100644 --- a/account_move_line_report_xls/report/move_line_list_xls.py +++ b/account_move_line_report_xls/report/move_line_list_xls.py @@ -136,7 +136,9 @@ class move_line_xls(report_xls): [1, 0, _render("line.date_maturity.val and 'date' or 'text'"), _render( - "line.date_maturity.val and datetime.strptime(line.date_maturity,'%Y-%m-%d') or None"), + "line.date_maturity.val\ + and datetime.strptime(line.date_maturity,'%Y-%m-%d')\ + or None"), None, self.aml_cell_style_date], 'totals': [1, 0, 'text', None]}, 'debit': { @@ -296,9 +298,10 @@ class move_line_xls(report_xls): if not (credit_pos and debit_pos) and 'balance' in wanted_list: raise orm.except_orm( _('Customisation Error!'), - _("The 'Balance' field is a calculated XLS field requiring the presence of the 'Debit' and 'Credit' fields !")) + _("The 'Balance' field is a calculated XLS field requiring\ + the presence of the 'Debit' and 'Credit' fields !")) - #report_name = objects[0]._description or objects[0]._name + # report_name = objects[0]._description or objects[0]._name report_name = _("Journal Items") ws = wb.add_sheet(report_name[:31]) ws.panes_frozen = True @@ -364,5 +367,3 @@ class move_line_xls(report_xls): move_line_xls('report.move.line.list.xls', 'account.move.line', parser=move_line_xls_parser) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: