From d78bb0cd0732ba16cd08f7018e4a613b8a89303f Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Tue, 11 Oct 2016 14:13:39 +0200 Subject: [PATCH 1/3] Migration of account_financial_report_qweb to 10.0 --- account_financial_report_qweb/__manifest__.py | 5 ++--- account_financial_report_qweb/models/account.py | 2 +- account_financial_report_qweb/report/abstract_report_xlsx.py | 2 +- account_financial_report_qweb/report/aged_partner_balance.py | 4 ++-- .../report/aged_partner_balance_xlsx.py | 4 ++-- account_financial_report_qweb/report/general_ledger.py | 4 ++-- account_financial_report_qweb/report/general_ledger_xlsx.py | 4 ++-- account_financial_report_qweb/report/open_items.py | 4 ++-- account_financial_report_qweb/report/open_items_xlsx.py | 4 ++-- account_financial_report_qweb/report/trial_balance.py | 4 ++-- account_financial_report_qweb/report/trial_balance_xlsx.py | 4 ++-- account_financial_report_qweb/tests/abstract_test.py | 2 +- .../wizard/aged_partner_balance_wizard.py | 2 +- .../wizard/general_ledger_wizard.py | 2 +- account_financial_report_qweb/wizard/open_items_wizard.py | 2 +- account_financial_report_qweb/wizard/trial_balance_wizard.py | 2 +- 16 files changed, 25 insertions(+), 26 deletions(-) diff --git a/account_financial_report_qweb/__manifest__.py b/account_financial_report_qweb/__manifest__.py index 55417f12..3101fcb5 100644 --- a/account_financial_report_qweb/__manifest__.py +++ b/account_financial_report_qweb/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'QWeb Financial Reports', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Reporting', 'summary': 'OCA Financial Reports', 'author': 'Camptocamp SA,' @@ -15,7 +15,6 @@ "website": "https://odoo-community.org/", 'depends': [ 'account', - 'account_full_reconcile', 'date_range', 'account_fiscal_year', 'report_xlsx', @@ -37,7 +36,7 @@ ], 'test': [ ], - 'installable': False, + 'installable': True, 'application': True, 'auto_install': False, 'license': 'AGPL-3', diff --git a/account_financial_report_qweb/models/account.py b/account_financial_report_qweb/models/account.py index 65af2995..f5f1e715 100644 --- a/account_financial_report_qweb/models/account.py +++ b/account_financial_report_qweb/models/account.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # © 2011 Guewen Baconnier (Camptocamp) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).- -from openerp import models, fields +from odoo import models, fields class AccountAccount(models.Model): diff --git a/account_financial_report_qweb/report/abstract_report_xlsx.py b/account_financial_report_qweb/report/abstract_report_xlsx.py index 041d0f05..24d5e5bc 100644 --- a/account_financial_report_qweb/report/abstract_report_xlsx.py +++ b/account_financial_report_qweb/report/abstract_report_xlsx.py @@ -5,7 +5,7 @@ from cStringIO import StringIO import xlsxwriter -from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx +from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx class AbstractReportXslx(ReportXlsx): diff --git a/account_financial_report_qweb/report/aged_partner_balance.py b/account_financial_report_qweb/report/aged_partner_balance.py index 91bb88c0..bebd4bfa 100644 --- a/account_financial_report_qweb/report/aged_partner_balance.py +++ b/account_financial_report_qweb/report/aged_partner_balance.py @@ -2,7 +2,7 @@ # © 2016 Julien Coux (Camptocamp) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class AgedPartnerBalanceReport(models.TransientModel): @@ -194,7 +194,7 @@ class AgedPartnerBalanceReportCompute(models.TransientModel): else: report_name = 'account_financial_report_qweb.' \ 'report_aged_partner_balance_qweb' - return self.env['report'].get_action(records=self, + return self.env['report'].get_action(docids=self.ids, report_name=report_name) def _prepare_report_open_items(self): diff --git a/account_financial_report_qweb/report/aged_partner_balance_xlsx.py b/account_financial_report_qweb/report/aged_partner_balance_xlsx.py index 7f31ea4b..ab23da2b 100644 --- a/account_financial_report_qweb/report/aged_partner_balance_xlsx.py +++ b/account_financial_report_qweb/report/aged_partner_balance_xlsx.py @@ -4,8 +4,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import abstract_report_xlsx -from openerp.report import report_sxw -from openerp import _ +from odoo.report import report_sxw +from odoo import _ class AgedPartnerBalanceXslx(abstract_report_xlsx.AbstractReportXslx): diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py index c2399a53..87ac5e36 100644 --- a/account_financial_report_qweb/report/general_ledger.py +++ b/account_financial_report_qweb/report/general_ledger.py @@ -2,7 +2,7 @@ # © 2016 Julien Coux (Camptocamp) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ +from odoo import models, fields, api, _ class GeneralLedgerReport(models.TransientModel): @@ -205,7 +205,7 @@ class GeneralLedgerReportCompute(models.TransientModel): else: report_name = 'account_financial_report_qweb.' \ 'report_general_ledger_qweb' - return self.env['report'].get_action(records=self, + return self.env['report'].get_action(docids=self.ids, report_name=report_name) @api.multi diff --git a/account_financial_report_qweb/report/general_ledger_xlsx.py b/account_financial_report_qweb/report/general_ledger_xlsx.py index f76d744a..e7b99cf0 100644 --- a/account_financial_report_qweb/report/general_ledger_xlsx.py +++ b/account_financial_report_qweb/report/general_ledger_xlsx.py @@ -5,8 +5,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import abstract_report_xlsx -from openerp.report import report_sxw -from openerp import _ +from odoo.report import report_sxw +from odoo import _ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx): diff --git a/account_financial_report_qweb/report/open_items.py b/account_financial_report_qweb/report/open_items.py index 50a8920f..649c66fb 100644 --- a/account_financial_report_qweb/report/open_items.py +++ b/account_financial_report_qweb/report/open_items.py @@ -2,7 +2,7 @@ # © 2016 Julien Coux (Camptocamp) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ +from odoo import models, fields, api, _ class OpenItemsReport(models.TransientModel): @@ -150,7 +150,7 @@ class OpenItemsReportCompute(models.TransientModel): else: report_name = 'account_financial_report_qweb.' \ 'report_open_items_qweb' - return self.env['report'].get_action(records=self, + return self.env['report'].get_action(docids=self.ids, report_name=report_name) @api.multi diff --git a/account_financial_report_qweb/report/open_items_xlsx.py b/account_financial_report_qweb/report/open_items_xlsx.py index 344617de..63bd02fb 100644 --- a/account_financial_report_qweb/report/open_items_xlsx.py +++ b/account_financial_report_qweb/report/open_items_xlsx.py @@ -4,8 +4,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import abstract_report_xlsx -from openerp.report import report_sxw -from openerp import _ +from odoo.report import report_sxw +from odoo import _ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx): diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index 80b30f9a..c929601e 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -2,7 +2,7 @@ # © 2016 Julien Coux (Camptocamp) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class TrialBalanceReport(models.TransientModel): @@ -130,7 +130,7 @@ class TrialBalanceReportCompute(models.TransientModel): else: report_name = 'account_financial_report_qweb.' \ 'report_trial_balance_qweb' - return self.env['report'].get_action(records=self, + return self.env['report'].get_action(docids=self.ids, report_name=report_name) def _prepare_report_general_ledger(self): diff --git a/account_financial_report_qweb/report/trial_balance_xlsx.py b/account_financial_report_qweb/report/trial_balance_xlsx.py index a56b3b4f..daee52db 100644 --- a/account_financial_report_qweb/report/trial_balance_xlsx.py +++ b/account_financial_report_qweb/report/trial_balance_xlsx.py @@ -4,8 +4,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import abstract_report_xlsx -from openerp.report import report_sxw -from openerp import _ +from odoo.report import report_sxw +from odoo import _ class TrialBalanceXslx(abstract_report_xlsx.AbstractReportXslx): diff --git a/account_financial_report_qweb/tests/abstract_test.py b/account_financial_report_qweb/tests/abstract_test.py index 0f97f173..232ad1f4 100644 --- a/account_financial_report_qweb/tests/abstract_test.py +++ b/account_financial_report_qweb/tests/abstract_test.py @@ -3,7 +3,7 @@ # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase class AbstractTest(TransactionCase): diff --git a/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py b/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py index 1a6fed82..5f65cb45 100644 --- a/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py +++ b/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from datetime import datetime -from openerp import api, fields, models +from odoo import api, fields, models class AgedPartnerBalance(models.TransientModel): diff --git a/account_financial_report_qweb/wizard/general_ledger_wizard.py b/account_financial_report_qweb/wizard/general_ledger_wizard.py index c066cba0..74643375 100644 --- a/account_financial_report_qweb/wizard/general_ledger_wizard.py +++ b/account_financial_report_qweb/wizard/general_ledger_wizard.py @@ -4,7 +4,7 @@ # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class GeneralLedgerReportWizard(models.TransientModel): diff --git a/account_financial_report_qweb/wizard/open_items_wizard.py b/account_financial_report_qweb/wizard/open_items_wizard.py index e122f11d..8a061a97 100644 --- a/account_financial_report_qweb/wizard/open_items_wizard.py +++ b/account_financial_report_qweb/wizard/open_items_wizard.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from datetime import datetime -from openerp import models, fields, api +from odoo import models, fields, api class OpenItemsReportWizard(models.TransientModel): diff --git a/account_financial_report_qweb/wizard/trial_balance_wizard.py b/account_financial_report_qweb/wizard/trial_balance_wizard.py index 17abdfdd..343b2a04 100644 --- a/account_financial_report_qweb/wizard/trial_balance_wizard.py +++ b/account_financial_report_qweb/wizard/trial_balance_wizard.py @@ -3,7 +3,7 @@ # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class TrialBalanceReportWizard(models.TransientModel): From 6c3e09081d56d2057d7e3cf2055fc3a57db80391 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Mon, 17 Oct 2016 09:34:26 +0200 Subject: [PATCH 2/3] [ADD] Add setup.py --- setup/account_financial_report_qweb/odoo/__init__.py | 1 + setup/account_financial_report_qweb/odoo/addons/__init__.py | 1 + .../odoo/addons/account_financial_report_qweb | 1 + setup/account_financial_report_qweb/setup.py | 6 ++++++ 4 files changed, 9 insertions(+) create mode 100644 setup/account_financial_report_qweb/odoo/__init__.py create mode 100644 setup/account_financial_report_qweb/odoo/addons/__init__.py create mode 120000 setup/account_financial_report_qweb/odoo/addons/account_financial_report_qweb create mode 100644 setup/account_financial_report_qweb/setup.py diff --git a/setup/account_financial_report_qweb/odoo/__init__.py b/setup/account_financial_report_qweb/odoo/__init__.py new file mode 100644 index 00000000..de40ea7c --- /dev/null +++ b/setup/account_financial_report_qweb/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_financial_report_qweb/odoo/addons/__init__.py b/setup/account_financial_report_qweb/odoo/addons/__init__.py new file mode 100644 index 00000000..de40ea7c --- /dev/null +++ b/setup/account_financial_report_qweb/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_financial_report_qweb/odoo/addons/account_financial_report_qweb b/setup/account_financial_report_qweb/odoo/addons/account_financial_report_qweb new file mode 120000 index 00000000..6330e5be --- /dev/null +++ b/setup/account_financial_report_qweb/odoo/addons/account_financial_report_qweb @@ -0,0 +1 @@ +../../../../account_financial_report_qweb \ No newline at end of file diff --git a/setup/account_financial_report_qweb/setup.py b/setup/account_financial_report_qweb/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/account_financial_report_qweb/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From 588923de06464fb75869bc2594ddeecaf957646c Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Mon, 9 Jan 2017 19:20:43 +0100 Subject: [PATCH 3/3] [FIX] Give id instead of recordset. --- account_financial_report_qweb/tests/abstract_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_qweb/tests/abstract_test.py b/account_financial_report_qweb/tests/abstract_test.py index 232ad1f4..fbf69fe8 100644 --- a/account_financial_report_qweb/tests/abstract_test.py +++ b/account_financial_report_qweb/tests/abstract_test.py @@ -41,7 +41,7 @@ class AbstractTest(TransactionCase): # Check if report template is correct report_html = self.env['report'].get_html( - self.report, self.qweb_report_name + self.report.id, self.qweb_report_name ) self.assertTrue(self.report_title.encode('utf8') in report_html) self.assertTrue(