Browse Source

[pep8] - review on account_export_csv, account_move_line_report_xls, account_journal_report_xls, account_financial_report_horizontal, account_financial_report_webkit_xls

pull/6/head
laetitia.gangloff@acsone.eu 10 years ago
parent
commit
8ce2b82351
  1. 2
      account_export_csv/__init__.py
  2. 4
      account_export_csv/__openerp__.py
  3. 2
      account_export_csv/wizard/__init__.py
  4. 1
      account_export_csv/wizard/account_export_csv.py
  5. 4
      account_financial_report_horizontal/__init__.py
  6. 4
      account_financial_report_horizontal/report/__init__.py
  7. 8
      account_financial_report_horizontal/report/account_balance_sheet.py
  8. 8
      account_financial_report_horizontal/report/account_profit_loss.py
  9. 25
      account_financial_report_horizontal/report/common_report_header.py
  10. 8
      account_financial_report_horizontal/wizard/__init__.py
  11. 2
      account_financial_report_horizontal/wizard/account_report_balance_sheet.py
  12. 4
      account_financial_report_horizontal/wizard/account_report_common.py
  13. 2
      account_financial_report_horizontal/wizard/account_report_common_account.py
  14. 2
      account_financial_report_horizontal/wizard/account_report_profit_loss.py
  15. 5
      account_financial_report_webkit_xls/__openerp__.py
  16. 2
      account_financial_report_webkit_xls/report/__init__.py
  17. 8
      account_financial_report_webkit_xls/report/general_ledger_xls.py
  18. 50
      account_financial_report_webkit_xls/report/open_invoices_xls.py
  19. 11
      account_financial_report_webkit_xls/report/partner_ledger_xls.py
  20. 9
      account_financial_report_webkit_xls/report/partners_balance_xls.py
  21. 6
      account_financial_report_webkit_xls/report/trial_balance_xls.py
  22. 4
      account_financial_report_webkit_xls/wizard/general_ledger_wizard.py
  23. 4
      account_financial_report_webkit_xls/wizard/open_invoices_wizard.py
  24. 4
      account_financial_report_webkit_xls/wizard/partners_balance_wizard.py
  25. 4
      account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py
  26. 4
      account_financial_report_webkit_xls/wizard/trial_balance_wizard.py
  27. 2
      account_journal_report_xls/__init__.py
  28. 2
      account_journal_report_xls/__openerp__.py
  29. 6
      account_journal_report_xls/report/__init__.py
  30. 6
      account_journal_report_xls/report/nov_account_journal.py
  31. 12
      account_journal_report_xls/report/nov_account_journal_xls.py
  32. 2
      account_journal_report_xls/wizard/__init__.py
  33. 6
      account_journal_report_xls/wizard/print_journal_wizard.py
  34. 11
      account_move_line_report_xls/report/move_line_list_xls.py

2
account_export_csv/__init__.py

@ -19,4 +19,4 @@
# #
############################################################################## ##############################################################################
import wizard
from . import wizard

4
account_export_csv/__openerp__.py

@ -29,7 +29,7 @@
'description': """ 'description': """
Add a wizard that allow you to export a csv file based on accounting Add a wizard that allow you to export a csv file based on accounting
journal entries
journal entries
- Trial Balance - Trial Balance
- Analytic Balance (with accounts) - Analytic Balance (with accounts)
@ -38,7 +38,7 @@ journal entries
You can filter by period You can filter by period
TODO: rearange wizard view with only one button to generate file plus 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', 'website': 'http://www.camptocamp.com',
'data': [ 'data': [

2
account_export_csv/wizard/__init__.py

@ -19,4 +19,4 @@
# #
############################################################################## ##############################################################################
import account_export_csv
from . import account_export_csv

1
account_export_csv/wizard/account_export_csv.py

@ -333,7 +333,6 @@ class AccountCSVExport(orm.TransientModel):
account_move_reconcile.name as full_reconcile, account_move_reconcile.name as full_reconcile,
account_move_line.reconcile_partial_id AS partial_reconcile_id, account_move_line.reconcile_partial_id AS partial_reconcile_id,
account_analytic_account.code AS analytic_account_code, account_analytic_account.code AS analytic_account_code,
account_move.name AS entry_number, account_move.name AS entry_number,
account_account.name AS account_name, account_account.name AS account_name,
account_move_line.debit - account_move_line.credit AS balance, account_move_line.debit - account_move_line.credit AS balance,

4
account_financial_report_horizontal/__init__.py

@ -1,2 +1,2 @@
import report
import wizard
from . import report
from . import wizard

4
account_financial_report_horizontal/report/__init__.py

@ -1,3 +1,3 @@
# import account_balance # import account_balance
import account_balance_sheet
import account_profit_loss
from . import account_balance_sheet
from . import account_profit_loss

8
account_financial_report_horizontal/report/account_balance_sheet.py

@ -24,7 +24,6 @@
import time import time
import openerp.pooler as pooler
from openerp.report import report_sxw from openerp.report import report_sxw
from openerp.addons.account_financial_report_horizontal.report import ( from openerp.addons.account_financial_report_horizontal.report import (
account_profit_loss account_profit_loss
@ -97,14 +96,13 @@ class report_balancesheet_horizontal(
def get_data(self, data): def get_data(self, data):
cr, uid = self.cr, self.uid cr, uid = self.cr, self.uid
db_pool = pooler.get_pool(self.cr.dbname)
# Getting Profit or Loss Balance from profit and Loss report # Getting Profit or Loss Balance from profit and Loss report
self.obj_pl.get_data(data) self.obj_pl.get_data(data)
self.res_bl = self.obj_pl.final_result() 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 = [ types = [
'liability', 'liability',
@ -276,5 +274,3 @@ report_sxw.report_sxw(
'account_balance_sheet.rml', 'account_balance_sheet.rml',
parser=report_balancesheet_horizontal, parser=report_balancesheet_horizontal,
header='internal') header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

8
account_financial_report_horizontal/report/account_profit_loss.py

@ -22,7 +22,6 @@
############################################################################## ##############################################################################
import time import time
import openerp.pooler as pooler
from openerp.report import report_sxw from openerp.report import report_sxw
from common_report_header import common_report_header from common_report_header import common_report_header
from openerp.tools.translate import _ 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 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 = [ types = [
'expense', 'expense',
@ -247,5 +245,3 @@ report_sxw.report_sxw(
'addons/account_financial_report_horizontal/report/' 'addons/account_financial_report_horizontal/report/'
'account_profit_loss.rml', 'account_profit_loss.rml',
parser=report_pl_account_horizontal, header='internal') parser=report_pl_account_horizontal, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

25
account_financial_report_horizontal/report/common_report_header.py

@ -19,7 +19,6 @@
# #
############################################################################## ##############################################################################
import openerp.pooler as pooler
from openerp.tools.translate import _ from openerp.tools.translate import _
@ -44,25 +43,25 @@ class common_report_header(object):
def get_start_period(self, data): def get_start_period(self, data):
if data.get('form', False) and data['form'].get('period_from', False): 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 '' return ''
def get_end_period(self, data): def get_end_period(self, data):
if data.get('form', False) and data['form'].get('period_to', False): 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 '' return ''
def _get_account(self, data): def _get_account(self, data):
if data.get('form', False) and data['form'].get( if data.get('form', False) and data['form'].get(
'chart_account_id', False '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 '' return ''
def _get_sortby(self, data): def _get_sortby(self, data):
@ -80,7 +79,7 @@ class common_report_header(object):
if data.get('form', False) and data['form'].get( if data.get('form', False) and data['form'].get(
'fiscalyear_id', False '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 '' return ''

8
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

2
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): class account_bs_report(orm.TransientModel):

4
account_financial_report_horizontal/wizard/account_report_common.py

@ -24,8 +24,8 @@
import time import time
from lxml import etree 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): class account_common_report(orm.TransientModel):

2
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): class account_common_account_report(orm.TransientModel):

2
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): class account_pl_report(orm.TransientModel):

5
account_financial_report_webkit_xls/__openerp__.py

@ -36,9 +36,8 @@
""", """,
'depends': ['report_xls', 'account_financial_report_webkit'], 'depends': ['report_xls', 'account_financial_report_webkit'],
'demo_xml': [],
'init_xml': [],
'update_xml': [
'demo': [],
'data': [
'wizard/general_ledger_wizard_view.xml', 'wizard/general_ledger_wizard_view.xml',
'wizard/trial_balance_wizard_view.xml', 'wizard/trial_balance_wizard_view.xml',
'wizard/partners_ledger_wizard_view.xml', 'wizard/partners_ledger_wizard_view.xml',

2
account_financial_report_webkit_xls/report/__init__.py

@ -25,5 +25,3 @@ from . import trial_balance_xls
from . import partners_balance_xls from . import partners_balance_xls
from . import partner_ledger_xls from . import partner_ledger_xls
from . import open_invoices_xls from . import open_invoices_xls
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

8
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\ from openerp.addons.account_financial_report_webkit.report.general_ledger\
import GeneralLedgerWebkit import GeneralLedgerWebkit
from openerp.tools.translate import _ from openerp.tools.translate import _
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
_column_sizes = [ _column_sizes = [
('date', 12), ('date', 12),
@ -146,7 +146,8 @@ class general_ledger_xls(report_xls):
c_hdr_cell_style = xlwt.easyxf(cell_format) c_hdr_cell_style = xlwt.easyxf(cell_format)
c_hdr_cell_style_right = xlwt.easyxf(cell_format + _xs['right']) 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_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) num_format_str=report_xls.decimal_format)
# Column Initial Balance Row # Column Initial Balance Row
@ -350,4 +351,3 @@ class general_ledger_xls(report_xls):
general_ledger_xls('report.account.account_report_general_ledger_xls', general_ledger_xls('report.account.account_report_general_ledger_xls',
'account.account', 'account.account',
parser=GeneralLedgerWebkit) parser=GeneralLedgerWebkit)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

50
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\ from openerp.addons.account_financial_report_webkit.report.open_invoices\
import PartnersOpenInvoicesWebkit import PartnersOpenInvoicesWebkit
from openerp.tools.translate import _ from openerp.tools.translate import _
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class open_invoices_xls(report_xls): class open_invoices_xls(report_xls):
@ -45,7 +45,7 @@ class open_invoices_xls(report_xls):
ws.fit_width_to_pages = 1 ws.fit_width_to_pages = 1
ws.header_str = self.xls_headers['standard'] ws.header_str = self.xls_headers['standard']
ws.footer_str = self.xls_footers['standard'] ws.footer_str = self.xls_footers['standard']
#-------------------------------------------------------
# -------------------------------------------------------
# number of columns is 11 in case of normal report, 13 in case the # 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 currency is selected and 12 in case of the regroup by currency
# option is checked # option is checked
@ -62,90 +62,90 @@ class open_invoices_xls(report_xls):
nbr_columns = 13 nbr_columns = 13
else: else:
nbr_columns = 11 nbr_columns = 11
#-------------------------------------------------------
# -------------------------------------------------------
global style_font12 # cell style for report title global style_font12 # cell style for report title
style_font12 = xlwt.easyxf(_xs['xls_title']) style_font12 = xlwt.easyxf(_xs['xls_title'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_default global style_default
style_default = xlwt.easyxf(_xs['borders_all']) style_default = xlwt.easyxf(_xs['borders_all'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_default_italic global style_default_italic
style_default_italic = xlwt.easyxf(_xs['borders_all'] + _xs['italic']) style_default_italic = xlwt.easyxf(_xs['borders_all'] + _xs['italic'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_bold global style_bold
style_bold = xlwt.easyxf(_xs['bold'] + _xs['borders_all']) style_bold = xlwt.easyxf(_xs['bold'] + _xs['borders_all'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_bold_center global style_bold_center
style_bold_center = xlwt.easyxf( style_bold_center = xlwt.easyxf(
_xs['bold'] + _xs['borders_all'] + _xs['center']) _xs['bold'] + _xs['borders_all'] + _xs['center'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_bold_italic global style_bold_italic
style_bold_italic = xlwt.easyxf( style_bold_italic = xlwt.easyxf(
_xs['bold'] + _xs['borders_all'] + _xs['italic']) _xs['bold'] + _xs['borders_all'] + _xs['italic'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_bold_italic_decimal global style_bold_italic_decimal
style_bold_italic_decimal = xlwt.easyxf( style_bold_italic_decimal = xlwt.easyxf(
_xs['bold'] + _xs['borders_all'] + _xs['italic'] + _xs['right'], _xs['bold'] + _xs['borders_all'] + _xs['italic'] + _xs['right'],
num_format_str=report_xls.decimal_format) num_format_str=report_xls.decimal_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_bold_blue global style_bold_blue
style_bold_blue = xlwt.easyxf( style_bold_blue = xlwt.easyxf(
_xs['bold'] + _xs['fill_blue'] + _xs['borders_all']) _xs['bold'] + _xs['fill_blue'] + _xs['borders_all'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_bold_blue_italic_decimal global style_bold_blue_italic_decimal
style_bold_blue_italic_decimal = xlwt.easyxf( style_bold_blue_italic_decimal = xlwt.easyxf(
_xs['bold'] + _xs['fill_blue'] + _xs['bold'] + _xs['fill_blue'] +
_xs['borders_all'] + _xs['italic'], _xs['borders_all'] + _xs['italic'],
num_format_str=report_xls.decimal_format) num_format_str=report_xls.decimal_format)
#-------------------------------------------------------
# -------------------------------------------------------
# cell style for header titles: 'Chart of accounts' - 'Fiscal year' ... # cell style for header titles: 'Chart of accounts' - 'Fiscal year' ...
global style_bold_blue_center global style_bold_blue_center
style_bold_blue_center = xlwt.easyxf( style_bold_blue_center = xlwt.easyxf(
_xs['bold'] + _xs['fill_blue'] + _xs['borders_all'] + _xs['bold'] + _xs['fill_blue'] + _xs['borders_all'] +
_xs['center']) _xs['center'])
#-------------------------------------------------------
# -------------------------------------------------------
# cell style for header data: 'Chart of accounts' - 'Fiscal year' ... # cell style for header data: 'Chart of accounts' - 'Fiscal year' ...
global style_center global style_center
style_center = xlwt.easyxf( style_center = xlwt.easyxf(
_xs['borders_all'] + _xs['wrap'] + _xs['center']) _xs['borders_all'] + _xs['wrap'] + _xs['center'])
#-------------------------------------------------------
# -------------------------------------------------------
# cell style for columns titles 'Date'- 'Period' - 'Entry'... # cell style for columns titles 'Date'- 'Period' - 'Entry'...
global style_yellow_bold global style_yellow_bold
style_yellow_bold = xlwt.easyxf( style_yellow_bold = xlwt.easyxf(
_xs['bold'] + _xs['fill'] + _xs['borders_all']) _xs['bold'] + _xs['fill'] + _xs['borders_all'])
#-------------------------------------------------------
# -------------------------------------------------------
# cell style for columns titles 'Date'- 'Period' - 'Entry'... # cell style for columns titles 'Date'- 'Period' - 'Entry'...
global style_yellow_bold_right global style_yellow_bold_right
style_yellow_bold_right = xlwt.easyxf( style_yellow_bold_right = xlwt.easyxf(
_xs['bold'] + _xs['fill'] + _xs['borders_all'] + _xs['right']) _xs['bold'] + _xs['fill'] + _xs['borders_all'] + _xs['right'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_right global style_right
style_right = xlwt.easyxf(_xs['borders_all'] + _xs['right']) style_right = xlwt.easyxf(_xs['borders_all'] + _xs['right'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_right_italic global style_right_italic
style_right_italic = xlwt.easyxf( style_right_italic = xlwt.easyxf(
_xs['borders_all'] + _xs['right'] + _xs['italic']) _xs['borders_all'] + _xs['right'] + _xs['italic'])
#-------------------------------------------------------
# -------------------------------------------------------
global style_decimal global style_decimal
style_decimal = xlwt.easyxf( style_decimal = xlwt.easyxf(
_xs['borders_all'] + _xs['right'], _xs['borders_all'] + _xs['right'],
num_format_str=report_xls.decimal_format) num_format_str=report_xls.decimal_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_decimal_italic global style_decimal_italic
style_decimal_italic = xlwt.easyxf( style_decimal_italic = xlwt.easyxf(
_xs['borders_all'] + _xs['right'] + _xs['italic'], _xs['borders_all'] + _xs['right'] + _xs['italic'],
num_format_str=report_xls.decimal_format) num_format_str=report_xls.decimal_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_date global style_date
style_date = xlwt.easyxf( style_date = xlwt.easyxf(
_xs['borders_all'] + _xs['left'], _xs['borders_all'] + _xs['left'],
num_format_str=report_xls.date_format) num_format_str=report_xls.date_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_date_italic global style_date_italic
style_date_italic = xlwt.easyxf( style_date_italic = xlwt.easyxf(
_xs['borders_all'] + _xs['left'] + _xs['italic'], _xs['borders_all'] + _xs['left'] + _xs['italic'],
num_format_str=report_xls.date_format) num_format_str=report_xls.date_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_account_title, style_account_title_right,\ global style_account_title, style_account_title_right,\
style_account_title_decimal style_account_title_decimal
cell_format = _xs['xls_title'] + _xs['bold'] + \ cell_format = _xs['xls_title'] + _xs['bold'] + \
@ -155,11 +155,11 @@ class open_invoices_xls(report_xls):
style_account_title_decimal = xlwt.easyxf( style_account_title_decimal = xlwt.easyxf(
cell_format + _xs['right'], cell_format + _xs['right'],
num_format_str=report_xls.decimal_format) num_format_str=report_xls.decimal_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_partner_row global style_partner_row
cell_format = _xs['bold'] cell_format = _xs['bold']
style_partner_row = xlwt.easyxf(cell_format) style_partner_row = xlwt.easyxf(cell_format)
#-------------------------------------------------------
# -------------------------------------------------------
global style_partner_cumul, style_partner_cumul_right,\ global style_partner_cumul, style_partner_cumul_right,\
style_partner_cumul_center, style_partner_cumul_decimal style_partner_cumul_center, style_partner_cumul_decimal
cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all'] cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all']

11
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\ from openerp.addons.account_financial_report_webkit.report.partners_ledger\
import PartnersLedgerWebkit import PartnersLedgerWebkit
from openerp.tools.translate import _ from openerp.tools.translate import _
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
_column_sizes = [ _column_sizes = [
('date', 12), ('date', 12),
@ -331,7 +331,7 @@ class partner_ledger_xls(report_xls):
debit_cell = rowcol_to_cell(row_pos, 7) debit_cell = rowcol_to_cell(row_pos, 7)
credit_cell = rowcol_to_cell(row_pos, 8) credit_cell = rowcol_to_cell(row_pos, 8)
cumbal_formula += debit_cell + '-' + credit_cell cumbal_formula += debit_cell + '-' + credit_cell
################## Print row ledger line data #########
# Print row ledger line data #
if line.get('ldate'): if line.get('ldate'):
c_specs = [ c_specs = [
@ -376,7 +376,7 @@ class partner_ledger_xls(report_xls):
ws, row_pos, row_data, ll_cell_style) ws, row_pos, row_data, ll_cell_style)
# end for line # 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_start = rowcol_to_cell(row_start_partner, 7)
debit_partner_end = rowcol_to_cell(row_pos - 1, 7) debit_partner_end = rowcol_to_cell(row_pos - 1, 7)
debit_partner_total = 'SUM(' + debit_partner_start + \ 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 += cumul_balance
account_balance_cumul_curr += cumul_balance_curr account_balance_cumul_curr += cumul_balance_curr
################## Print row Cumulated Balance by account #####
# Print row Cumulated Balance by account #
c_specs = [ c_specs = [
('acc_title', 5, 0, 'text', ' - '. ('acc_title', 5, 0, 'text', ' - '.
join([account.code, account.name])), ] 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', partner_ledger_xls('report.account.account_report_partner_ledger_xls',
'account.account', 'account.account',
parser=PartnersLedgerWebkit) parser=PartnersLedgerWebkit)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

9
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\ from openerp.addons.account_financial_report_webkit.report.partner_balance\
import PartnerBalanceWebkit import PartnerBalanceWebkit
from openerp.tools.translate import _ from openerp.tools.translate import _
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
def display_line(all_comparison_lines): def display_line(all_comparison_lines):
@ -295,7 +295,8 @@ class partners_balance_xls(report_xls):
regular_cell_style_center = xlwt.easyxf( regular_cell_style_center = xlwt.easyxf(
regular_cell_format + _xs['center']) regular_cell_format + _xs['center'])
regular_cell_style_decimal = xlwt.easyxf( 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_style_pct = xlwt.easyxf(
regular_cell_format + _xs['center'], num_format_str='0') 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', partners_balance_xls('report.account.account_report_partner_balance_xls',
'account.account', 'account.account',
parser=PartnerBalanceWebkit) parser=PartnerBalanceWebkit)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

6
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\ from openerp.addons.account_financial_report_webkit.report.trial_balance\
import TrialBalanceWebkit import TrialBalanceWebkit
from openerp.tools.translate import _ from openerp.tools.translate import _
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class trial_balance_xls(report_xls): 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', trial_balance_xls('report.account.account_report_trial_balance_xls',
'account.account', 'account.account',
parser=TrialBalanceWebkit) parser=TrialBalanceWebkit)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

4
account_financial_report_webkit_xls/wizard/general_ledger_wizard.py

@ -21,8 +21,8 @@
############################################################################## ##############################################################################
from openerp.osv import orm from openerp.osv import orm
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class general_ledger_webkit_wizard(orm.TransientModel): class general_ledger_webkit_wizard(orm.TransientModel):

4
account_financial_report_webkit_xls/wizard/open_invoices_wizard.py

@ -21,8 +21,8 @@
############################################################################## ##############################################################################
from openerp.osv import orm from openerp.osv import orm
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class open_invoices_webkit_wizard(orm.TransientModel): class open_invoices_webkit_wizard(orm.TransientModel):

4
account_financial_report_webkit_xls/wizard/partners_balance_wizard.py

@ -21,8 +21,8 @@
############################################################################## ##############################################################################
from openerp.osv import orm from openerp.osv import orm
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class partner_balance_wizard(orm.TransientModel): class partner_balance_wizard(orm.TransientModel):

4
account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py

@ -21,8 +21,8 @@
############################################################################## ##############################################################################
from openerp.osv import orm from openerp.osv import orm
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class partner_ledger_webkit_wizard(orm.TransientModel): class partner_ledger_webkit_wizard(orm.TransientModel):

4
account_financial_report_webkit_xls/wizard/trial_balance_wizard.py

@ -21,8 +21,8 @@
############################################################################## ##############################################################################
from openerp.osv import orm from openerp.osv import orm
#import logging
#_logger = logging.getLogger(__name__)
# import logging
# _logger = logging.getLogger(__name__)
class trial_balance_wizard(orm.TransientModel): class trial_balance_wizard(orm.TransientModel):

2
account_journal_report_xls/__init__.py

@ -28,5 +28,3 @@ except ImportError:
import logging import logging
logging.getLogger('openerp.module').warning('''report_xls not available in logging.getLogger('openerp.module').warning('''report_xls not available in
addons path. account_financial_report_webkit_xls will not be usable''') addons path. account_financial_report_webkit_xls will not be usable''')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

2
account_journal_report_xls/__openerp__.py

@ -52,5 +52,3 @@ cf. https://launchpad.net/openerp-reporting-engines
'wizard/print_journal_wizard.xml', 'wizard/print_journal_wizard.xml',
], ],
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

6
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

6
account_journal_report_xls/report/nov_account_journal.py

@ -216,7 +216,7 @@ class nov_journal_print(report_sxw.rml_parse):
else: else:
code_string = j_obj._report_xls_document_extra( code_string = j_obj._report_xls_document_extra(
self.cr, self.uid, self.context) 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] [x.update({'docname': eval(code_string) or '-'}) for x in lines]
# group lines # group lines
@ -261,7 +261,7 @@ class nov_journal_print(report_sxw.rml_parse):
key = (line['account_id'], key = (line['account_id'],
line['tax_code_id'], line['tax_code_id'],
line['partner_id']) line['partner_id'])
if not key in lines_grouped:
if key not in lines_grouped:
lines_grouped[key] = line lines_grouped[key] = line
else: else:
lines_grouped[key]['debit'] += line['debit'] lines_grouped[key]['debit'] += line['debit']
@ -358,5 +358,3 @@ report_sxw.report_sxw(
'report.nov.account.journal.print', 'account.journal', 'report.nov.account.journal.print', 'account.journal',
'addons/account_journal_report_xls/report/nov_account_journal.rml', 'addons/account_journal_report_xls/report/nov_account_journal.rml',
parser=nov_journal_print, header=False) parser=nov_journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

12
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')")], 'header': [1, 20, 'text', _render("_('Entry')")],
'lines': 'lines':
[1, 0, 'text', [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]}, 'totals': [1, 0, 'text', None]},
'move_date': { 'move_date': {
'header': [1, 13, 'text', _render("_('Date')")], 'header': [1, 13, 'text', _render("_('Date')")],
@ -141,7 +142,8 @@ class account_journal_xls(report_xls):
[1, 0, [1, 0,
_render("l['date_maturity'] and 'date' or 'text'"), _render("l['date_maturity'] and 'date' or 'text'"),
_render( _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], None, self.aml_cell_style_date],
'totals': [1, 0, 'text', None]}, 'totals': [1, 0, 'text', None]},
'debit': { 'debit': {
@ -374,7 +376,9 @@ class account_journal_xls(report_xls):
if not (self.credit_pos and self.debit_pos) and 'balance'\ if not (self.credit_pos and self.debit_pos) and 'balance'\
in wanted_list: in wanted_list:
raise orm.except_orm(_('Customisation Error!'), 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: 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', account_journal_xls('report.nov.account.journal.xls', 'account.journal.period',
parser=account_journal_xls_parser) parser=account_journal_xls_parser)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

2
account_journal_report_xls/wizard/__init__.py

@ -21,5 +21,3 @@
############################################################################## ##############################################################################
from . import print_journal_wizard from . import print_journal_wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

6
account_journal_report_xls/wizard/print_journal_wizard.py

@ -114,7 +114,9 @@ class account_print_journal_xls(orm.TransientModel):
FROM account_period ap FROM account_period ap
WHERE ap.date_start>=%s AND ap.date_stop<=%s AND company_id=%s WHERE ap.date_start>=%s AND ap.date_stop<=%s AND company_id=%s
ORDER BY date_start, special DESC""", 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_period_ids = map(lambda x: x[0], cr.fetchall())
wiz_journal_ids = [j.id for j in wiz_form.journal_ids] 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', 'type': 'ir.actions.report.xml',
'report_name': 'nov.account.journal.print', 'report_name': 'nov.account.journal.print',
'datas': datas} 'datas': datas}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

11
account_move_line_report_xls/report/move_line_list_xls.py

@ -136,7 +136,9 @@ class move_line_xls(report_xls):
[1, 0, [1, 0,
_render("line.date_maturity.val and 'date' or 'text'"), _render("line.date_maturity.val and 'date' or 'text'"),
_render( _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], None, self.aml_cell_style_date],
'totals': [1, 0, 'text', None]}, 'totals': [1, 0, 'text', None]},
'debit': { 'debit': {
@ -296,9 +298,10 @@ class move_line_xls(report_xls):
if not (credit_pos and debit_pos) and 'balance' in wanted_list: if not (credit_pos and debit_pos) and 'balance' in wanted_list:
raise orm.except_orm( raise orm.except_orm(
_('Customisation Error!'), _('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") report_name = _("Journal Items")
ws = wb.add_sheet(report_name[:31]) ws = wb.add_sheet(report_name[:31])
ws.panes_frozen = True ws.panes_frozen = True
@ -364,5 +367,3 @@ class move_line_xls(report_xls):
move_line_xls('report.move.line.list.xls', move_line_xls('report.move.line.list.xls',
'account.move.line', 'account.move.line',
parser=move_line_xls_parser) parser=move_line_xls_parser)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Loading…
Cancel
Save