From 9cd0c233236e660ff21870af6af9410e0cdcd750 Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Thu, 9 Oct 2014 11:57:45 +0200 Subject: [PATCH 1/4] [CHG] Migration to v8 --- .../__init__.py | 0 .../__openerp__.py | 0 .../account.py | 0 .../account_move_line.py | 0 .../account_view.xml | 0 .../data/financial_webkit_header.xml | 0 .../i18n/account_financial_report_webkit.pot | 0 .../i18n/de.po | 0 .../i18n/en_US.po | 0 .../i18n/es.po | 0 .../i18n/fr.po | 0 .../i18n/it.po | 0 .../i18n/nl.po | 0 .../images/ledger.png | Bin .../report/__init__.py | 0 .../report/aged_partner_balance.py | 0 .../report/common_balance_reports.py | 0 .../report/common_partner_balance_reports.py | 0 .../report/common_partner_reports.py | 0 .../report/common_reports.py | 0 .../report/general_ledger.py | 0 .../report/open_invoices.py | 0 .../report/partner_balance.py | 0 .../report/partners_ledger.py | 0 .../report/print_journal.py | 0 .../report/report.xml | 0 .../templates/account_report_general_ledger.mako | 0 .../templates/account_report_open_invoices.mako | 0 .../templates/account_report_partner_balance.mako | 0 .../templates/account_report_partners_ledger.mako | 0 .../templates/account_report_print_journal.mako | 0 .../templates/account_report_profit_loss.mako | 0 .../templates/account_report_trial_balance.mako | 0 .../report/templates/aged_trial_webkit.mako | 0 ...rouped_by_curr_open_invoices_inclusion.mako.html | 0 .../templates/open_invoices_inclusion.mako.html | 0 .../report/trial_balance.py | 0 .../report/webkit_parser_header_fix.py | 0 .../report_menus.xml | 0 .../static/src/img/icon.png | Bin .../tests/account_move_line.yml | 0 .../tests/aged_trial_balance.yml | 0 .../tests/general_ledger.yml | 0 .../tests/open_invoices.yml | 0 .../tests/partner_balance.yml | 0 .../tests/partner_ledger.yml | 0 .../tests/trial_balance.yml | 0 .../wizard/__init__.py | 0 .../wizard/aged_partner_balance_wizard.py | 0 .../wizard/aged_partner_balance_wizard.xml | 0 .../wizard/balance_common.py | 0 .../wizard/balance_common_view.xml | 0 .../wizard/general_ledger_wizard.py | 0 .../wizard/general_ledger_wizard_view.xml | 0 .../wizard/open_invoices_wizard.py | 0 .../wizard/open_invoices_wizard_view.xml | 0 .../wizard/partner_balance_wizard.py | 0 .../wizard/partner_balance_wizard_view.xml | 0 .../wizard/partners_ledger_wizard.py | 0 .../wizard/partners_ledger_wizard_view.xml | 0 .../wizard/print_journal.py | 0 .../wizard/print_journal_view.xml | 0 .../wizard/trial_balance_wizard.py | 0 .../wizard/trial_balance_wizard_view.xml | 0 .../wizard/wizard.xml | 0 65 files changed, 0 insertions(+), 0 deletions(-) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/__init__.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/__openerp__.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/account.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/account_move_line.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/account_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/data/financial_webkit_header.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/account_financial_report_webkit.pot (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/de.po (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/en_US.po (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/es.po (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/fr.po (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/it.po (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/i18n/nl.po (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/images/ledger.png (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/__init__.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/aged_partner_balance.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/common_balance_reports.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/common_partner_balance_reports.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/common_partner_reports.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/common_reports.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/general_ledger.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/open_invoices.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/partner_balance.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/partners_ledger.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/print_journal.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/report.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_general_ledger.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_open_invoices.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_partner_balance.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_partners_ledger.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_print_journal.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_profit_loss.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/account_report_trial_balance.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/aged_trial_webkit.mako (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/templates/open_invoices_inclusion.mako.html (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/trial_balance.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report/webkit_parser_header_fix.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/report_menus.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/static/src/img/icon.png (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/account_move_line.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/aged_trial_balance.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/general_ledger.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/open_invoices.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/partner_balance.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/partner_ledger.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/tests/trial_balance.yml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/__init__.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/aged_partner_balance_wizard.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/aged_partner_balance_wizard.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/balance_common.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/balance_common_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/general_ledger_wizard.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/general_ledger_wizard_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/open_invoices_wizard.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/open_invoices_wizard_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/partner_balance_wizard.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/partner_balance_wizard_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/partners_ledger_wizard.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/partners_ledger_wizard_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/print_journal.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/print_journal_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/trial_balance_wizard.py (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/trial_balance_wizard_view.xml (100%) rename {__unported__/account_financial_report_webkit => account_financial_report_webkit}/wizard/wizard.xml (100%) diff --git a/__unported__/account_financial_report_webkit/__init__.py b/account_financial_report_webkit/__init__.py similarity index 100% rename from __unported__/account_financial_report_webkit/__init__.py rename to account_financial_report_webkit/__init__.py diff --git a/__unported__/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py similarity index 100% rename from __unported__/account_financial_report_webkit/__openerp__.py rename to account_financial_report_webkit/__openerp__.py diff --git a/__unported__/account_financial_report_webkit/account.py b/account_financial_report_webkit/account.py similarity index 100% rename from __unported__/account_financial_report_webkit/account.py rename to account_financial_report_webkit/account.py diff --git a/__unported__/account_financial_report_webkit/account_move_line.py b/account_financial_report_webkit/account_move_line.py similarity index 100% rename from __unported__/account_financial_report_webkit/account_move_line.py rename to account_financial_report_webkit/account_move_line.py diff --git a/__unported__/account_financial_report_webkit/account_view.xml b/account_financial_report_webkit/account_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/account_view.xml rename to account_financial_report_webkit/account_view.xml diff --git a/__unported__/account_financial_report_webkit/data/financial_webkit_header.xml b/account_financial_report_webkit/data/financial_webkit_header.xml similarity index 100% rename from __unported__/account_financial_report_webkit/data/financial_webkit_header.xml rename to account_financial_report_webkit/data/financial_webkit_header.xml diff --git a/__unported__/account_financial_report_webkit/i18n/account_financial_report_webkit.pot b/account_financial_report_webkit/i18n/account_financial_report_webkit.pot similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/account_financial_report_webkit.pot rename to account_financial_report_webkit/i18n/account_financial_report_webkit.pot diff --git a/__unported__/account_financial_report_webkit/i18n/de.po b/account_financial_report_webkit/i18n/de.po similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/de.po rename to account_financial_report_webkit/i18n/de.po diff --git a/__unported__/account_financial_report_webkit/i18n/en_US.po b/account_financial_report_webkit/i18n/en_US.po similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/en_US.po rename to account_financial_report_webkit/i18n/en_US.po diff --git a/__unported__/account_financial_report_webkit/i18n/es.po b/account_financial_report_webkit/i18n/es.po similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/es.po rename to account_financial_report_webkit/i18n/es.po diff --git a/__unported__/account_financial_report_webkit/i18n/fr.po b/account_financial_report_webkit/i18n/fr.po similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/fr.po rename to account_financial_report_webkit/i18n/fr.po diff --git a/__unported__/account_financial_report_webkit/i18n/it.po b/account_financial_report_webkit/i18n/it.po similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/it.po rename to account_financial_report_webkit/i18n/it.po diff --git a/__unported__/account_financial_report_webkit/i18n/nl.po b/account_financial_report_webkit/i18n/nl.po similarity index 100% rename from __unported__/account_financial_report_webkit/i18n/nl.po rename to account_financial_report_webkit/i18n/nl.po diff --git a/__unported__/account_financial_report_webkit/images/ledger.png b/account_financial_report_webkit/images/ledger.png similarity index 100% rename from __unported__/account_financial_report_webkit/images/ledger.png rename to account_financial_report_webkit/images/ledger.png diff --git a/__unported__/account_financial_report_webkit/report/__init__.py b/account_financial_report_webkit/report/__init__.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/__init__.py rename to account_financial_report_webkit/report/__init__.py diff --git a/__unported__/account_financial_report_webkit/report/aged_partner_balance.py b/account_financial_report_webkit/report/aged_partner_balance.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/aged_partner_balance.py rename to account_financial_report_webkit/report/aged_partner_balance.py diff --git a/__unported__/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/common_balance_reports.py rename to account_financial_report_webkit/report/common_balance_reports.py diff --git a/__unported__/account_financial_report_webkit/report/common_partner_balance_reports.py b/account_financial_report_webkit/report/common_partner_balance_reports.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/common_partner_balance_reports.py rename to account_financial_report_webkit/report/common_partner_balance_reports.py diff --git a/__unported__/account_financial_report_webkit/report/common_partner_reports.py b/account_financial_report_webkit/report/common_partner_reports.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/common_partner_reports.py rename to account_financial_report_webkit/report/common_partner_reports.py diff --git a/__unported__/account_financial_report_webkit/report/common_reports.py b/account_financial_report_webkit/report/common_reports.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/common_reports.py rename to account_financial_report_webkit/report/common_reports.py diff --git a/__unported__/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/general_ledger.py rename to account_financial_report_webkit/report/general_ledger.py diff --git a/__unported__/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/open_invoices.py rename to account_financial_report_webkit/report/open_invoices.py diff --git a/__unported__/account_financial_report_webkit/report/partner_balance.py b/account_financial_report_webkit/report/partner_balance.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/partner_balance.py rename to account_financial_report_webkit/report/partner_balance.py diff --git a/__unported__/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/partners_ledger.py rename to account_financial_report_webkit/report/partners_ledger.py diff --git a/__unported__/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/print_journal.py rename to account_financial_report_webkit/report/print_journal.py diff --git a/__unported__/account_financial_report_webkit/report/report.xml b/account_financial_report_webkit/report/report.xml similarity index 100% rename from __unported__/account_financial_report_webkit/report/report.xml rename to account_financial_report_webkit/report/report.xml diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_general_ledger.mako b/account_financial_report_webkit/report/templates/account_report_general_ledger.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_general_ledger.mako rename to account_financial_report_webkit/report/templates/account_report_general_ledger.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_open_invoices.mako b/account_financial_report_webkit/report/templates/account_report_open_invoices.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_open_invoices.mako rename to account_financial_report_webkit/report/templates/account_report_open_invoices.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_partner_balance.mako b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_partner_balance.mako rename to account_financial_report_webkit/report/templates/account_report_partner_balance.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako b/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako rename to account_financial_report_webkit/report/templates/account_report_partners_ledger.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_print_journal.mako b/account_financial_report_webkit/report/templates/account_report_print_journal.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_print_journal.mako rename to account_financial_report_webkit/report/templates/account_report_print_journal.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_profit_loss.mako b/account_financial_report_webkit/report/templates/account_report_profit_loss.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_profit_loss.mako rename to account_financial_report_webkit/report/templates/account_report_profit_loss.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/account_report_trial_balance.mako b/account_financial_report_webkit/report/templates/account_report_trial_balance.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/account_report_trial_balance.mako rename to account_financial_report_webkit/report/templates/account_report_trial_balance.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/aged_trial_webkit.mako b/account_financial_report_webkit/report/templates/aged_trial_webkit.mako similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/aged_trial_webkit.mako rename to account_financial_report_webkit/report/templates/aged_trial_webkit.mako diff --git a/__unported__/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html b/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html rename to account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html diff --git a/__unported__/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html b/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html similarity index 100% rename from __unported__/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html rename to account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html diff --git a/__unported__/account_financial_report_webkit/report/trial_balance.py b/account_financial_report_webkit/report/trial_balance.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/trial_balance.py rename to account_financial_report_webkit/report/trial_balance.py diff --git a/__unported__/account_financial_report_webkit/report/webkit_parser_header_fix.py b/account_financial_report_webkit/report/webkit_parser_header_fix.py similarity index 100% rename from __unported__/account_financial_report_webkit/report/webkit_parser_header_fix.py rename to account_financial_report_webkit/report/webkit_parser_header_fix.py diff --git a/__unported__/account_financial_report_webkit/report_menus.xml b/account_financial_report_webkit/report_menus.xml similarity index 100% rename from __unported__/account_financial_report_webkit/report_menus.xml rename to account_financial_report_webkit/report_menus.xml diff --git a/__unported__/account_financial_report_webkit/static/src/img/icon.png b/account_financial_report_webkit/static/src/img/icon.png similarity index 100% rename from __unported__/account_financial_report_webkit/static/src/img/icon.png rename to account_financial_report_webkit/static/src/img/icon.png diff --git a/__unported__/account_financial_report_webkit/tests/account_move_line.yml b/account_financial_report_webkit/tests/account_move_line.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/account_move_line.yml rename to account_financial_report_webkit/tests/account_move_line.yml diff --git a/__unported__/account_financial_report_webkit/tests/aged_trial_balance.yml b/account_financial_report_webkit/tests/aged_trial_balance.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/aged_trial_balance.yml rename to account_financial_report_webkit/tests/aged_trial_balance.yml diff --git a/__unported__/account_financial_report_webkit/tests/general_ledger.yml b/account_financial_report_webkit/tests/general_ledger.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/general_ledger.yml rename to account_financial_report_webkit/tests/general_ledger.yml diff --git a/__unported__/account_financial_report_webkit/tests/open_invoices.yml b/account_financial_report_webkit/tests/open_invoices.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/open_invoices.yml rename to account_financial_report_webkit/tests/open_invoices.yml diff --git a/__unported__/account_financial_report_webkit/tests/partner_balance.yml b/account_financial_report_webkit/tests/partner_balance.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/partner_balance.yml rename to account_financial_report_webkit/tests/partner_balance.yml diff --git a/__unported__/account_financial_report_webkit/tests/partner_ledger.yml b/account_financial_report_webkit/tests/partner_ledger.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/partner_ledger.yml rename to account_financial_report_webkit/tests/partner_ledger.yml diff --git a/__unported__/account_financial_report_webkit/tests/trial_balance.yml b/account_financial_report_webkit/tests/trial_balance.yml similarity index 100% rename from __unported__/account_financial_report_webkit/tests/trial_balance.yml rename to account_financial_report_webkit/tests/trial_balance.yml diff --git a/__unported__/account_financial_report_webkit/wizard/__init__.py b/account_financial_report_webkit/wizard/__init__.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/__init__.py rename to account_financial_report_webkit/wizard/__init__.py diff --git a/__unported__/account_financial_report_webkit/wizard/aged_partner_balance_wizard.py b/account_financial_report_webkit/wizard/aged_partner_balance_wizard.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/aged_partner_balance_wizard.py rename to account_financial_report_webkit/wizard/aged_partner_balance_wizard.py diff --git a/__unported__/account_financial_report_webkit/wizard/aged_partner_balance_wizard.xml b/account_financial_report_webkit/wizard/aged_partner_balance_wizard.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/aged_partner_balance_wizard.xml rename to account_financial_report_webkit/wizard/aged_partner_balance_wizard.xml diff --git a/__unported__/account_financial_report_webkit/wizard/balance_common.py b/account_financial_report_webkit/wizard/balance_common.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/balance_common.py rename to account_financial_report_webkit/wizard/balance_common.py diff --git a/__unported__/account_financial_report_webkit/wizard/balance_common_view.xml b/account_financial_report_webkit/wizard/balance_common_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/balance_common_view.xml rename to account_financial_report_webkit/wizard/balance_common_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/general_ledger_wizard.py b/account_financial_report_webkit/wizard/general_ledger_wizard.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/general_ledger_wizard.py rename to account_financial_report_webkit/wizard/general_ledger_wizard.py diff --git a/__unported__/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml rename to account_financial_report_webkit/wizard/general_ledger_wizard_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/open_invoices_wizard.py b/account_financial_report_webkit/wizard/open_invoices_wizard.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/open_invoices_wizard.py rename to account_financial_report_webkit/wizard/open_invoices_wizard.py diff --git a/__unported__/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml b/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml rename to account_financial_report_webkit/wizard/open_invoices_wizard_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/partner_balance_wizard.py b/account_financial_report_webkit/wizard/partner_balance_wizard.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/partner_balance_wizard.py rename to account_financial_report_webkit/wizard/partner_balance_wizard.py diff --git a/__unported__/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml rename to account_financial_report_webkit/wizard/partner_balance_wizard_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/partners_ledger_wizard.py b/account_financial_report_webkit/wizard/partners_ledger_wizard.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/partners_ledger_wizard.py rename to account_financial_report_webkit/wizard/partners_ledger_wizard.py diff --git a/__unported__/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml rename to account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/print_journal.py b/account_financial_report_webkit/wizard/print_journal.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/print_journal.py rename to account_financial_report_webkit/wizard/print_journal.py diff --git a/__unported__/account_financial_report_webkit/wizard/print_journal_view.xml b/account_financial_report_webkit/wizard/print_journal_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/print_journal_view.xml rename to account_financial_report_webkit/wizard/print_journal_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/trial_balance_wizard.py b/account_financial_report_webkit/wizard/trial_balance_wizard.py similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/trial_balance_wizard.py rename to account_financial_report_webkit/wizard/trial_balance_wizard.py diff --git a/__unported__/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml b/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml rename to account_financial_report_webkit/wizard/trial_balance_wizard_view.xml diff --git a/__unported__/account_financial_report_webkit/wizard/wizard.xml b/account_financial_report_webkit/wizard/wizard.xml similarity index 100% rename from __unported__/account_financial_report_webkit/wizard/wizard.xml rename to account_financial_report_webkit/wizard/wizard.xml From 7c0a04744e89e28e58523b7b3c4a34d1024ab566 Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Thu, 9 Oct 2014 17:34:48 +0200 Subject: [PATCH 2/4] [CHG] Migration to v8 --- .../__openerp__.py | 2 +- account_financial_report_webkit/account.py | 2 +- .../report/general_ledger.py | 22 ++++++++------- .../report/open_invoices.py | 4 +-- .../report/partners_ledger.py | 27 ++++++++++++------- .../account_report_general_ledger.mako | 18 ++++++------- .../account_report_partner_balance.mako | 2 +- .../account_report_partners_ledger.mako | 18 ++++++------- .../report/templates/aged_trial_webkit.mako | 2 +- ..._by_curr_open_invoices_inclusion.mako.html | 4 +-- .../open_invoices_inclusion.mako.html | 6 ++--- .../report/webkit_parser_header_fix.py | 18 ++++++------- .../tests/aged_trial_balance.yml | 10 +++---- .../tests/general_ledger.yml | 12 ++++----- .../tests/open_invoices.yml | 10 +++---- .../tests/partner_balance.yml | 12 ++++----- .../tests/partner_ledger.yml | 10 +++---- .../tests/trial_balance.yml | 12 ++++----- 18 files changed, 101 insertions(+), 90 deletions(-) diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 38a374be..22de6562 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -202,6 +202,6 @@ wkhtmltopdf. The texts are defined inside the report classes. 'tests/aged_trial_balance.yml'], # 'tests/account_move_line.yml' 'active': False, - 'installable': False, + 'installable': True, 'application': True, } diff --git a/account_financial_report_webkit/account.py b/account_financial_report_webkit/account.py index 97a63797..4e1118ee 100644 --- a/account_financial_report_webkit/account.py +++ b/account_financial_report_webkit/account.py @@ -39,7 +39,7 @@ class AccountAccount(orm.Model): 'Centralized', help="If flagged, no details will be displayed in " "the General Ledger report (the webkit one only), " - "only centralized amounts per period.") + "only centralized amounts per period."), } _defaults = { diff --git a/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py index 0f62a270..df7e60bf 100644 --- a/account_financial_report_webkit/report/general_ledger.py +++ b/account_financial_report_webkit/report/general_ledger.py @@ -119,20 +119,22 @@ class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): ledger_lines_memoizer = self._compute_account_ledger_lines( accounts, init_balance_memoizer, main_filter, target_move, start, stop) - objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - accounts): + objects = self.pool.get('account.account').browse(self.cursor, + self.uid, + accounts) + + init_balance = {} + ledger_lines = {} + for account in objects: if do_centralize and account.centralized \ and ledger_lines_memoizer.get(account.id): - account.ledger_lines = self._centralize_lines( + ledger_lines[account.id] = self._centralize_lines( main_filter, ledger_lines_memoizer.get(account.id, [])) else: - account.ledger_lines = ledger_lines_memoizer.get( + ledger_lines[account.id] = ledger_lines_memoizer.get( account.id, []) - account.init_balance = init_balance_memoizer.get(account.id, {}) - - objects.append(account) + init_balance[account.id] = init_balance_memoizer.get(account.id, + {}) self.localcontext.update({ 'fiscalyear': fiscalyear, @@ -142,6 +144,8 @@ class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): 'stop_period': stop_period, 'chart_account': chart_account, 'initial_balance_mode': initial_balance_mode, + 'init_balance': init_balance, + 'ledger_lines': ledger_lines, }) return super(GeneralLedgerWebkit, self).set_context( diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index 4e58d4ad..ace849ee 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -26,7 +26,6 @@ from operator import itemgetter from mako.template import Template -import openerp.addons from openerp import pooler from openerp.osv import osv from openerp.report import report_sxw @@ -34,10 +33,11 @@ from openerp.tools.translate import _ from openerp.addons.report_webkit import report_helper from .common_partner_reports import CommonPartnersReportHeaderWebkit from .webkit_parser_header_fix import HeaderFooterTextWebKitParser +from openerp.modules.module import get_module_resource def get_mako_template(obj, *args): - template_path = openerp.addons.get_module_resource(*args) + template_path = get_module_resource(*args) return Template(filename=template_path, input_encoding='utf-8') report_helper.WebKitHelper.get_mako_template = get_mako_template diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index 55c22ce4..df66efac 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -146,12 +146,17 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, ledger_lines = self._compute_partner_ledger_lines( accounts, main_filter, target_move, start, stop, partner_filter=partner_ids) - objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - accounts): - account.ledger_lines = ledger_lines.get(account.id, {}) - account.init_balance = initial_balance_lines.get(account.id, {}) + objects = self.pool.get('account.account').browse(self.cursor, + self.uid, + accounts) + + init_balance = {} + ledger_lines_dict = {} + partners_order = {} + for account in objects: + ledger_lines_dict[account.id] = ledger_lines.get(account.id, {}) + init_balance[account.id] = initial_balance_lines.get(account.id, + {}) # we have to compute partner order based on inital balance # and ledger line as we may have partner with init bal # that are not in ledger line and vice versa @@ -159,17 +164,16 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, if initial_balance_mode: non_null_init_balances = dict( [(ib, amounts) for ib, amounts - in account.init_balance.iteritems() + in init_balance[account.id].iteritems() if amounts['init_balance'] or amounts['init_balance_currency']]) init_bal_lines_pids = non_null_init_balances.keys() else: - account.init_balance = {} + init_balance[account.id] = {} init_bal_lines_pids = [] - account.partners_order = self._order_partners( + partners_order[account.id] = self._order_partners( ledg_lines_pids, init_bal_lines_pids) - objects.append(account) self.localcontext.update({ 'fiscalyear': fiscalyear, @@ -180,6 +184,9 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, 'partner_ids': partner_ids, 'chart_account': chart_account, 'initial_balance_mode': initial_balance_mode, + 'init_balance': init_balance, + 'ledger_lines': ledger_lines_dict, + 'partners_order': partners_order }) return super(PartnersLedgerWebkit, self).set_context( diff --git a/account_financial_report_webkit/report/templates/account_report_general_ledger.mako b/account_financial_report_webkit/report/templates/account_report_general_ledger.mako index f99f7283..4a39e91a 100644 --- a/account_financial_report_webkit/report/templates/account_report_general_ledger.mako +++ b/account_financial_report_webkit/report/templates/account_report_general_ledger.mako @@ -75,8 +75,8 @@ %for account in objects: <% - display_initial_balance = account.init_balance and (account.init_balance.get('debit', 0.0) != 0.0 or account.init_balance.get('credit', 0.0) != 0.0) - display_ledger_lines = account.ledger_lines + display_initial_balance = init_balance[account.id] and (init_balance[account.id].get('debit') != 0.0 or init_balance[account.id].get('credit', 0.0) != 0.0) + display_ledger_lines = ledger_lines[account.id] %> %if display_account_raw(data) == 'all' or (display_ledger_lines or display_initial_balance): <% @@ -128,10 +128,10 @@
%if display_initial_balance: <% - cumul_debit = account.init_balance.get('debit') or 0.0 - cumul_credit = account.init_balance.get('credit') or 0.0 - cumul_balance = account.init_balance.get('init_balance') or 0.0 - cumul_balance_curr = account.init_balance.get('init_balance_currency') or 0.0 + cumul_debit = init_balance[account.id].get('debit') or 0.0 + cumul_credit = init_balance[account.id].get('credit') or 0.0 + cumul_balance = init_balance[account.id].get('init_balance') or 0.0 + cumul_balance_curr = init_balance[account.id].get('init_balance_currency') or 0.0 %>
## date @@ -153,9 +153,9 @@ ## counterpart
## debit -
${formatLang(account.init_balance.get('debit')) | amount}
+
${formatLang(init_balance[account.id].get('debit')) | amount}
## credit -
${formatLang(account.init_balance.get('credit')) | amount}
+
${formatLang(init_balance[account.id].get('credit')) | amount}
## balance cumulated
${formatLang(cumul_balance) | amount }
%if amount_currency(data): @@ -167,7 +167,7 @@
%endif - %for line in account.ledger_lines: + %for line in ledger_lines[account.id]: <% cumul_debit += line.get('debit') or 0.0 cumul_credit += line.get('credit') or 0.0 diff --git a/account_financial_report_webkit/report/templates/account_report_partner_balance.mako b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako index 8e2cad7f..c05ae040 100644 --- a/account_financial_report_webkit/report/templates/account_report_partner_balance.mako +++ b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako @@ -105,7 +105,7 @@ %for current_account in objects: <% - partners_order = current_account.partners_order + partners_order = partners_order[current_account.id] # do not display accounts without partners if not partners_order: diff --git a/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako b/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako index 122964a9..4c6b75e5 100644 --- a/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako +++ b/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako @@ -69,9 +69,9 @@
%for account in objects: - %if account.ledger_lines or account.init_balance: + %if ledger_lines[account.id] or init_balance[account.id]: <% - if not account.partners_order: + if not partners_order[account.id]: continue account_total_debit = 0.0 account_total_credit = 0.0 @@ -81,7 +81,7 @@ - %for partner_name, p_id, p_ref, p_name in account.partners_order: + %for partner_name, p_id, p_ref, p_name in partners_order[account.id]: <% total_debit = 0.0 total_credit = 0.0 @@ -129,14 +129,14 @@
<% - total_debit = account.init_balance.get(p_id, {}).get('debit') or 0.0 - total_credit = account.init_balance.get(p_id, {}).get('credit') or 0.0 + total_debit = init_balance[account.id].get(p_id, {}).get('debit') or 0.0 + total_credit =init_balance[account.id].get(p_id, {}).get('credit') or 0.0 %> %if initial_balance_mode and (total_debit or total_credit): <% - part_cumul_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0 - part_cumul_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0 - balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or '' + part_cumul_balance = init_balance[account.id].get(p_id, {}).get('init_balance') or 0.0 + part_cumul_balance_curr = init_balance[account.id].get(p_id, {}).get('init_balance_currency') or 0.0 + balance_forward_currency = init_balance[account.id].get(p_id, {}).get('currency_name') or '' cumul_balance += part_cumul_balance cumul_balance_curr += part_cumul_balance_curr @@ -174,7 +174,7 @@
%endif - %for line in account.ledger_lines.get(p_id, []): + %for line in ledger_lines[account.id].get(p_id, []): <% total_debit += line.get('debit') or 0.0 total_credit += line.get('credit') or 0.0 diff --git a/account_financial_report_webkit/report/templates/aged_trial_webkit.mako b/account_financial_report_webkit/report/templates/aged_trial_webkit.mako index d021e252..ee62a4b9 100644 --- a/account_financial_report_webkit/report/templates/aged_trial_webkit.mako +++ b/account_financial_report_webkit/report/templates/aged_trial_webkit.mako @@ -110,7 +110,7 @@
- %for partner_name, p_id, p_ref, p_name in acc.partners_order: + %for partner_name, p_id, p_ref, p_name in partners_order[acc.id]: %if acc.aged_lines.get(p_id):
<%line = acc.aged_lines[p_id]%> diff --git a/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html b/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html index 91c49e47..e5c29aeb 100644 --- a/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html +++ b/account_financial_report_webkit/report/templates/grouped_by_curr_open_invoices_inclusion.mako.html @@ -1,13 +1,13 @@ ## -*- coding: utf-8 -*- <%page args="account, formatLang" /> -%if account.grouped_ledger_lines and account.partners_order: +%if account.grouped_ledger_lines and partners_order[account.id]: <% account_total_debit = 0.0 account_total_credit = 0.0 account_balance_cumul = 0.0 account_balance_cumul_curr = 0.0 %> - %for partner_name, p_id, p_ref, p_name in account.partners_order: + %for partner_name, p_id, p_ref, p_name in partners_order[account.id]: diff --git a/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html b/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html index e4969793..c61827bb 100644 --- a/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html +++ b/account_financial_report_webkit/report/templates/open_invoices_inclusion.mako.html @@ -1,6 +1,6 @@ ## -*- coding: utf-8 -*- <%page args="account, formatLang" /> -%if account.ledger_lines and account.partners_order: +%if ledger_lines[account.id] and partners_order[account.id]: <% account_total_debit = 0.0 account_total_credit = 0.0 @@ -10,7 +10,7 @@ - %for partner_name, p_id, p_ref, p_name in account.partners_order: + %for partner_name, p_id, p_ref, p_name in partners_order[account.id]: <% total_debit = 0.0 total_credit = 0.0 @@ -67,7 +67,7 @@ def amount(text): return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers) %> - %for line in account.ledger_lines.get(p_id, []): + %for line in ledger_lines[account.id].get(p_id, []): <% total_debit += line.get('debit') or 0.0 total_credit += line.get('credit') or 0.0 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 c52b61af..a92c90fa 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -35,13 +35,13 @@ from functools import partial from mako import exceptions -from openerp.osv.osv import except_osv +from openerp.osv.orm import except_orm from openerp.tools.translate import _ -from openerp import addons from openerp import pooler from openerp import tools from openerp.addons.report_webkit import webkit_report from openerp.addons.report_webkit.report_helper import WebKitHelper +from openerp.modules.module import get_module_resource _logger = logging.getLogger('financial.reports.webkit') @@ -163,7 +163,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): 'The following diagnosis message was provided:\n') + \ error_message if status: - raise except_osv(_('Webkit error'), + raise except_orm(_('Webkit error'), _("The command 'wkhtmltopdf' failed with \ error code = %s. Message: %s") % (status, error_message)) @@ -205,19 +205,19 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): template = False if report_xml.report_file: - path = addons.get_module_resource( + path = get_module_resource( *report_xml.report_file.split(os.path.sep)) if os.path.exists(path): template = file(path).read() if not template and report_xml.report_webkit_data: template = report_xml.report_webkit_data if not template: - raise except_osv( + raise except_orm( _('Error!'), _('Webkit Report template not found !')) header = report_xml.webkit_header.html if not header and report_xml.header: - raise except_osv( + raise except_orm( _('No header defined for this Webkit report!'), _('Please set a header in company settings.') ) @@ -243,7 +243,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): except Exception: msg = exceptions.text_error_template().render() _logger.error(msg) - raise except_osv(_('Webkit render'), msg) + raise except_orm(_('Webkit render'), msg) else: try: html = body_mako_tpl.render(helper=helper, @@ -254,7 +254,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): except Exception: msg = exceptions.text_error_template().render() _logger.error(msg) - raise except_osv(_('Webkit render'), msg) + raise except_orm(_('Webkit render'), msg) # NO html footer and header because we write them as text with # wkhtmltopdf @@ -270,7 +270,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): except Exception: msg = exceptions.text_error_template().render() _logger.error(msg) - raise except_osv(_('Webkit render'), msg) + raise except_orm(_('Webkit render'), msg) return (deb, 'html') bin = self.get_lib(cursor, uid) pdf = self.generate_pdf(bin, report_xml, head, foot, htmls, diff --git a/account_financial_report_webkit/tests/aged_trial_balance.yml b/account_financial_report_webkit/tests/aged_trial_balance.yml index fa311429..d94cddab 100644 --- a/account_financial_report_webkit/tests/aged_trial_balance.yml +++ b/account_financial_report_webkit/tests/aged_trial_balance.yml @@ -5,7 +5,7 @@ from datetime import datetime ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'until_date': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -17,7 +17,7 @@ data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier'} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -30,7 +30,7 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'partner_ids': [ref('base.res_partner_2'), ref('base.res_partner_1')]} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -43,7 +43,7 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'filter': 'filter_period', 'period_from': ref('account.period_1'), 'period_to': ref('account.period_12')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -56,5 +56,5 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'filter': 'filter_date', 'date_from': '%s-01-01' %(datetime.now().year), 'date_to': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') diff --git a/account_financial_report_webkit/tests/general_ledger.yml b/account_financial_report_webkit/tests/general_ledger.yml index 17f733d8..2f5143a7 100644 --- a/account_financial_report_webkit/tests/general_ledger.yml +++ b/account_financial_report_webkit/tests/general_ledger.yml @@ -5,7 +5,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0')} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -15,7 +15,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'posted'} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -25,7 +25,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'display_account': 'bal_mix'} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -35,7 +35,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'amount_currency': 1} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') #Filter by date @@ -48,7 +48,7 @@ data_dict = {'chart_account_id':ref('account.chart0'),'amount_currency': 1, 'chart_account_id': 1, 'date_from': '%s-01-01' %(datetime.now().year), 'date_to':'%s-04-01' %(datetime.now().year), 'display_account': 'bal_all', 'filter': 'filter_date',} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -60,6 +60,6 @@ data_dict = {'chart_account_id':ref('account.chart0'),'amount_currency': 1, 'chart_account_id': 1, 'date_from': '%s-01-01' %(datetime.now().year), 'date_to':'%s-04-01' %(datetime.now().year), 'display_account': 'bal_all', 'filter': 'filter_date',} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') # I still have to parse report content but for this I need accounting data on multiple exercises and faor all fiscal year diff --git a/account_financial_report_webkit/tests/open_invoices.yml b/account_financial_report_webkit/tests/open_invoices.yml index a0d90b04..17b5942d 100644 --- a/account_financial_report_webkit/tests/open_invoices.yml +++ b/account_financial_report_webkit/tests/open_invoices.yml @@ -5,7 +5,7 @@ from datetime import datetime ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'until_date': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_open_invoices_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -17,7 +17,7 @@ data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier'} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_open_invoices_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -30,7 +30,7 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'partner_ids': [ref('base.res_partner_2'), ref('base.res_partner_1')]} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_open_invoices_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -43,7 +43,7 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'filter': 'filter_period', 'period_from': ref('account.period_1'), 'period_to': ref('account.period_12')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_open_invoices_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -56,5 +56,5 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'filter': 'filter_date', 'date_from': '%s-01-01' %(datetime.now().year), 'date_to': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_open_invoices_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') diff --git a/account_financial_report_webkit/tests/partner_balance.yml b/account_financial_report_webkit/tests/partner_balance.yml index 37613104..b67c3060 100644 --- a/account_financial_report_webkit/tests/partner_balance.yml +++ b/account_financial_report_webkit/tests/partner_balance.yml @@ -5,7 +5,7 @@ from datetime import datetime ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -16,7 +16,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0')} ctx.update({'model': 'account.account','active_ids':[ref('account.assets_view'), ref('account.liabilities_view')],'active_id': ref('account.assets_view')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -27,7 +27,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'filter': 'filter_period', 'period_from': ref('account.period_1'), 'period_to': ref('account.period_12')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -38,7 +38,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'filter': 'filter_date', 'date_from': '%s-01-01' %(datetime.now().year), 'date_to': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -49,7 +49,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'comp0_filter': 'filter_year', 'comp0_fiscalyear_id': ref('account.data_fiscalyear')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -63,5 +63,5 @@ 'comp1_filter': 'filter_period', 'comp1_period_from': ref('account.period_1'), 'comp1_period_to': ref('account.period_12'), 'comp2_filter': 'filter_date', 'comp2_date_from': '%s-01-01' %(datetime.now().year), 'comp2_date_to': '%s-12-31' %(datetime.now().year) } - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') diff --git a/account_financial_report_webkit/tests/partner_ledger.yml b/account_financial_report_webkit/tests/partner_ledger.yml index dc2302f0..459bc7bf 100644 --- a/account_financial_report_webkit/tests/partner_ledger.yml +++ b/account_financial_report_webkit/tests/partner_ledger.yml @@ -5,7 +5,7 @@ from datetime import datetime ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'until_date': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -17,7 +17,7 @@ data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier'} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -30,7 +30,7 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'partner_ids': [ref('base.res_partner_2'), ref('base.res_partner_1')]} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -43,7 +43,7 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'filter': 'filter_period', 'period_from': ref('account.period_1'), 'period_to': ref('account.period_12')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -56,5 +56,5 @@ 'until_date': '%s-12-31' %(datetime.now().year), 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'filter': 'filter_date', 'date_from': '%s-01-01' %(datetime.now().year), 'date_to': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') diff --git a/account_financial_report_webkit/tests/trial_balance.yml b/account_financial_report_webkit/tests/trial_balance.yml index f5d276c3..974dc3ca 100644 --- a/account_financial_report_webkit/tests/trial_balance.yml +++ b/account_financial_report_webkit/tests/trial_balance.yml @@ -5,7 +5,7 @@ from datetime import datetime ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -16,7 +16,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0')} ctx.update({'model': 'account.account','active_ids':[ref('account.assets_view'), ref('account.liabilities_view')],'active_id': ref('account.assets_view')}) - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -27,7 +27,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'filter': 'filter_period', 'period_from': ref('account.period_1'), 'period_to': ref('account.period_12')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -38,7 +38,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'filter': 'filter_date', 'date_from': '%s-01-01' %(datetime.now().year), 'date_to': '%s-12-31' %(datetime.now().year)} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -49,7 +49,7 @@ ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), 'comp0_filter': 'filter_year', 'comp0_fiscalyear_id': ref('account.data_fiscalyear')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') - @@ -63,5 +63,5 @@ 'comp1_filter': 'filter_period', 'comp1_period_from': ref('account.period_1'), 'comp1_period_to': ref('account.period_12'), 'comp2_filter': 'filter_date', 'comp2_date_from': '%s-01-01' %(datetime.now().year), 'comp2_date_to': '%s-12-31' %(datetime.now().year) } - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit') From 8e76fe6e61fe9e9574c1698b25b286cee71c415d Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Fri, 10 Oct 2014 13:43:46 +0200 Subject: [PATCH 3/4] [CHG]account_financial_report_webkit: Migration to v8 --- .../report/aged_partner_balance.py | 33 ++++++++--- .../report/common_balance_reports.py | 55 +++++++++++-------- .../report/common_partner_balance_reports.py | 54 ++++++++++++------ .../report/open_invoices.py | 29 ++++++---- .../account_report_partner_balance.mako | 6 +- .../account_report_trial_balance.mako | 12 ++-- .../report/templates/aged_trial_webkit.mako | 10 ++-- 7 files changed, 126 insertions(+), 73 deletions(-) diff --git a/account_financial_report_webkit/report/aged_partner_balance.py b/account_financial_report_webkit/report/aged_partner_balance.py index 721b787e..fd9cb550 100644 --- a/account_financial_report_webkit/report/aged_partner_balance.py +++ b/account_financial_report_webkit/report/aged_partner_balance.py @@ -128,6 +128,7 @@ class AccountAgedTrialBalanceWebkit(PartnersOpenInvoicesWebkit): call to set_context """ + res = super(AccountAgedTrialBalanceWebkit, self).set_context( objects, data, @@ -135,21 +136,35 @@ class AccountAgedTrialBalanceWebkit(PartnersOpenInvoicesWebkit): report_type=report_type ) + agged_lines_accounts = {} + agged_totals_accounts = {} + agged_percents_accounts = {} + for acc in self.objects: - acc.aged_lines = {} - acc.agged_totals = {} - acc.agged_percents = {} - for part_id, partner_lines in acc.ledger_lines.items(): + agged_lines_accounts[acc.id] = {} + agged_totals_accounts[acc.id] = {} + agged_percents_accounts[acc.id] = {} + + for part_id, partner_lines in\ + self.localcontext['ledger_lines'][acc.id].items(): + aged_lines = self.compute_aged_lines(part_id, partner_lines, data) if aged_lines: - acc.aged_lines[part_id] = aged_lines - acc.aged_totals = totals = self.compute_totals( - acc.aged_lines.values()) - acc.aged_percents = self.compute_percents(totals) + agged_lines_accounts[acc.id][part_id] = aged_lines + agged_totals_accounts[acc.id] = totals = self.compute_totals( + agged_lines_accounts[acc.id].values()) + agged_percents_accounts[acc.id] = self.compute_percents(totals) + + self.localcontext.update({ + 'agged_lines_accounts': agged_lines_accounts, + 'agged_totals_accounts': agged_totals_accounts, + 'agged_percents_accounts': agged_percents_accounts, + }) + # Free some memory - del(acc.ledger_lines) + del(self.localcontext['ledger_lines']) return res def compute_aged_lines(self, partner_id, ledger_lines, data): diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index c3017e3b..da21a34e 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -276,23 +276,30 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): comparison_params.append(comp_params) comp_accounts_by_ids.append(comparison_result) - to_display = dict.fromkeys(account_ids, True) - objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - account_ids): + objects = self.pool.get('account.account').browse(self.cursor, + self.uid, + account_ids) + + to_display_accounts = dict.fromkeys(account_ids, True) + init_balance_accounts = dict.fromkeys(account_ids, False) + comparisons_accounts = dict.fromkeys(account_ids, []) + debit_accounts = dict.fromkeys(account_ids, False) + credit_accounts = dict.fromkeys(account_ids, False) + balance_accounts = dict.fromkeys(account_ids, False) + + for account in objects: if not account.parent_id: # hide top level account continue if account.type == 'consolidation': - to_display.update( + to_display_accounts.update( dict([(a.id, False) for a in account.child_consol_ids])) elif account.type == 'view': - to_display.update( + to_display_accounts.update( dict([(a.id, True) for a in account.child_id])) - account.debit = accounts_by_ids[account.id]['debit'] - account.credit = accounts_by_ids[account.id]['credit'] - account.balance = accounts_by_ids[account.id]['balance'] - account.init_balance = accounts_by_ids[ + debit_accounts['account_id'] = accounts_by_ids[account.id]['debit'] + credit_accounts['account_id'] = accounts_by_ids[account.id]['credit'] + balance_accounts['account_id'] = accounts_by_ids[account.id]['balance'] + init_balance_accounts[account.id] = accounts_by_ids[ account.id].get('init_balance', 0.0) # if any amount is != 0 in comparisons, we have to display the @@ -308,21 +315,18 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): values.get('balance', 0.0), values.get('init_balance', 0.0))) comp_accounts.append(values) - account.comparisons = comp_accounts + comparisons_accounts[account.id] = comp_accounts # we have to display the account if a comparison as an amount or # if we have an amount in the main column # we set it as a property to let the data in the report if someone # want to use it in a custom report - display_account = display_account or any((account.debit, - account.credit, - account.balance, - account.init_balance)) - to_display.update( - {account.id: display_account and to_display[account.id]}) - objects.append(account) - - for account in objects: - account.to_display = to_display[account.id] + display_account = display_account\ + or any((account.debit, + account.credit, account.balance, + init_balance_accounts[account.id])) + to_display_accounts.update( + {account.id: display_account and + to_display_accounts[account.id]}) context_report_values = { 'fiscalyear': fiscalyear, @@ -336,5 +340,12 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): 'initial_balance': init_balance, 'initial_balance_mode': initial_balance_mode, 'comp_params': comparison_params, + 'to_display_accounts': to_display_accounts, + 'init_balance_accounts': init_balance_accounts, + 'comparisons_accounts': comparisons_accounts, + 'debit_accounts': debit_accounts, + 'credit_accounts': credit_accounts, + 'balance_accounts': balance_accounts, } + return objects, new_ids, context_report_values 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 08cc3818..b291a8bf 100644 --- a/account_financial_report_webkit/report/common_partner_balance_reports.py +++ b/account_financial_report_webkit/report/common_partner_balance_reports.py @@ -278,19 +278,29 @@ class CommonPartnerBalanceReportHeaderWebkit(CommonBalanceReportHeaderWebkit, partner_filter_ids=partner_ids) comparison_params.append(comp_params) comp_accounts_by_ids.append(comparison_result) - objects = [] - - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - account_ids): + objects = self.pool.get('account.account').browse(self.cursor, + self.uid, + account_ids) + + init_balance_accounts = {} + comparisons_accounts = {} + partners_order_accounts = {} + partners_amounts_accounts = {} + debit_accounts = {} + credit_accounts = {} + balance_accounts = {} + + for account in objects: if not account.parent_id: # hide top level account continue - account.debit = accounts_by_ids[account.id]['debit'] - account.credit = accounts_by_ids[account.id]['credit'] - account.balance = accounts_by_ids[account.id]['balance'] - account.init_balance = accounts_by_ids[ + debit_accounts[account.id] = accounts_by_ids[account.id]['debit'] + credit_accounts[account.id] = accounts_by_ids[account.id]['credit'] + balance_accounts[account.id] = \ + accounts_by_ids[account.id]['balance'] + init_balance_accounts[account.id] = accounts_by_ids[ account.id].get('init_balance', 0.0) - account.partners_amounts = partner_details_by_ids[account.id] + partners_amounts_accounts[account.id] =\ + partner_details_by_ids[account.id] comp_accounts = [] for comp_account_by_id in comp_accounts_by_ids: values = comp_account_by_id.get(account.id) @@ -302,24 +312,25 @@ class CommonPartnerBalanceReportHeaderWebkit(CommonBalanceReportHeaderWebkit, for partner_id, partner_values in \ values['partners_amounts'].copy().iteritems(): - base_partner_balance = account.partners_amounts[ - partner_id]['balance'] if \ - account.partners_amounts.get(partner_id) else 0.0 + base_partner_balance = partners_amounts_accounts[account.id][partner_id]['balance']\ + if partners_amounts_accounts.get(account.id)\ + and partners_amounts_accounts.get(account.id)\ + .get(partner_id) else 0.0 partner_values.update(self._get_diff( base_partner_balance, partner_values.get('balance', 0.0))) values['partners_amounts'][ partner_id].update(partner_values) - account.comparisons = comp_accounts + comparisons_accounts[account.id] = comp_accounts all_partner_ids = reduce(add, [comp['partners_amounts'].keys() for comp in comp_accounts], - account.partners_amounts.keys()) - - account.partners_order = self._order_partners(all_partner_ids) + partners_amounts_accounts[account.id] + .keys()) - objects.append(account) + partners_order_accounts[account.id] = \ + self._order_partners(all_partner_ids) context_report_values = { 'fiscalyear': fiscalyear, @@ -333,6 +344,13 @@ class CommonPartnerBalanceReportHeaderWebkit(CommonBalanceReportHeaderWebkit, 'comp_params': comparison_params, 'initial_balance_mode': initial_balance_mode, 'compute_diff': self._get_diff, + 'init_balance_accounts': init_balance_accounts, + 'comparisons_accounts': comparisons_accounts, + 'partners_order_accounts': partners_order_accounts, + 'partners_amounts_accounts': partners_amounts_accounts, + 'debit_accounts': debit_accounts, + 'credit_accounts': credit_accounts, + 'balance_accounts': balance_accounts, } return objects, new_ids, context_report_values diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index ace849ee..3afdd099 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -145,29 +145,35 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, ledger_lines_memoizer = self._compute_open_transactions_lines( account_ids, main_filter, target_move, start, stop, date_until, partner_filter=partner_ids) - objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - account_ids): - account.ledger_lines = ledger_lines_memoizer.get(account.id, {}) - account.init_balance = init_balance_memoizer.get(account.id, {}) + objects = self.pool.get('account.account').browse(self.cursor, + self.uid, + account_ids) + + ledger_lines = {} + init_balance = {} + partners_order = {} + for account in objects: + ledger_lines[account.id] = ledger_lines_memoizer.get(account.id, + {}) + init_balance[account.id] = init_balance_memoizer.get(account.id, + {}) # we have to compute partner order based on inital balance # and ledger line as we may have partner with init bal # that are not in ledger line and vice versa ledg_lines_pids = ledger_lines_memoizer.get(account.id, {}).keys() non_null_init_balances = dict([ (ib, amounts) for ib, amounts - in account.init_balance.iteritems() + in init_balance[account.id].iteritems() if amounts['init_balance'] or amounts['init_balance_currency']]) init_bal_lines_pids = non_null_init_balances.keys() - account.partners_order = self._order_partners( + partners_order[account.id] = self._order_partners( ledg_lines_pids, init_bal_lines_pids) - account.ledger_lines = ledger_lines_memoizer.get(account.id, {}) + ledger_lines[account.id] = ledger_lines_memoizer.get(account.id, + {}) if group_by_currency: self._group_lines_by_currency(account) - objects.append(account) self.localcontext.update({ 'fiscalyear': fiscalyear, @@ -178,6 +184,9 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, 'date_until': date_until, 'partner_ids': partner_ids, 'chart_account': chart_account, + 'ledger_lines': ledger_lines, + 'init_balance': init_balance, + 'partners_order': partners_order }) return super(PartnersOpenInvoicesWebkit, self).set_context( diff --git a/account_financial_report_webkit/report/templates/account_report_partner_balance.mako b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako index c05ae040..f9be09d9 100644 --- a/account_financial_report_webkit/report/templates/account_report_partner_balance.mako +++ b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako @@ -105,13 +105,13 @@ %for current_account in objects: <% - partners_order = partners_order[current_account.id] + partners_order = partners_order_accounts[current_account.id] # do not display accounts without partners if not partners_order: continue - comparisons = current_account.comparisons + comparisons = comparisons_accounts[current_account.id] # in multiple columns mode, we do not want to print accounts without any rows if comparison_mode in ('single', 'multiple'): @@ -121,7 +121,7 @@ if not display_line(all_comparison_lines): continue - current_partner_amounts = current_account.partners_amounts + current_partner_amounts = partners_amounts_accounts[current_account.id] total_initial_balance = 0.0 total_debit = 0.0 diff --git a/account_financial_report_webkit/report/templates/account_report_trial_balance.mako b/account_financial_report_webkit/report/templates/account_report_trial_balance.mako index cc833226..d4581002 100644 --- a/account_financial_report_webkit/report/templates/account_report_trial_balance.mako +++ b/account_financial_report_webkit/report/templates/account_report_trial_balance.mako @@ -161,10 +161,10 @@ %> %for current_account in objects: <% - if not current_account.to_display: + if not to_display_accounts[current_account.id]: continue - comparisons = current_account.comparisons + comparisons = comparisons_accounts[current_account.id] if current_account.id in last_child_consol_ids: # current account is a consolidation child of the last account: use the level of last account @@ -185,15 +185,15 @@ %if comparison_mode == 'no_comparison': %if initial_balance_mode: ## opening balance -
${formatLang(current_account.init_balance) | amount}
+
${formatLang(init_balance_accounts[current_account.id]) | amount}
%endif ## debit -
${formatLang(current_account.debit) | amount}
+
${formatLang(debit_accounts[current_account.id]) | amount}
## credit -
${formatLang(current_account.credit) | amount}
+
${formatLang(credit_accounts[current_account.id]) | amount}
%endif ## balance -
${formatLang(current_account.balance) | amount}
+
${formatLang(balance_accounts[current_account.id]) | amount}
%if comparison_mode in ('single', 'multiple'): %for comp_account in comparisons: diff --git a/account_financial_report_webkit/report/templates/aged_trial_webkit.mako b/account_financial_report_webkit/report/templates/aged_trial_webkit.mako index ee62a4b9..6ad17d7f 100644 --- a/account_financial_report_webkit/report/templates/aged_trial_webkit.mako +++ b/account_financial_report_webkit/report/templates/aged_trial_webkit.mako @@ -89,7 +89,7 @@
%for acc in objects: - %if acc.aged_lines: + %if agged_lines_accounts[acc.id]: @@ -111,11 +111,11 @@
%for partner_name, p_id, p_ref, p_name in partners_order[acc.id]: - %if acc.aged_lines.get(p_id): + %if agged_lines_accounts[acc.id].get(p_id):
- <%line = acc.aged_lines[p_id]%> - <%percents = acc.aged_percents%> - <%totals = acc.aged_totals%> + <%line = agged_lines_accounts[acc.id][p_id]%> + <%percents = agged_percents_accounts[acc.id]%> + <%totals = agged_totals_accounts[acc.id]%>
${partner_name}
${p_ref or ''}
From 78bb7af017461c78c18aae7afbbf371fba5f60aa Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Fri, 10 Oct 2014 14:01:08 +0200 Subject: [PATCH 4/4] [FIX]account_financial_report_webkit: pep8 --- .../report/common_balance_reports.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index da21a34e..3d3be9ac 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -296,11 +296,14 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): elif account.type == 'view': to_display_accounts.update( dict([(a.id, True) for a in account.child_id])) - debit_accounts['account_id'] = accounts_by_ids[account.id]['debit'] - credit_accounts['account_id'] = accounts_by_ids[account.id]['credit'] - balance_accounts['account_id'] = accounts_by_ids[account.id]['balance'] - init_balance_accounts[account.id] = accounts_by_ids[ - account.id].get('init_balance', 0.0) + debit_accounts['account_id'] = \ + accounts_by_ids[account.id]['debit'] + credit_accounts['account_id'] = \ + accounts_by_ids[account.id]['credit'] + balance_accounts['account_id'] = \ + accounts_by_ids[account.id]['balance'] + init_balance_accounts[account.id] = \ + accounts_by_ids[account.id].get('init_balance', 0.0) # if any amount is != 0 in comparisons, we have to display the # whole account