From 55abf04675b8af132d3c70912843723ac2af28ea Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 6 Jul 2017 16:50:43 +0200 Subject: [PATCH 1/3] [IMP] use RegistryManager.get instead of deprecated pooler --- account_financial_report_webkit/report/aged_open_invoices.py | 4 ++-- .../report/aged_partner_balance.py | 4 ++-- account_financial_report_webkit/report/general_ledger.py | 4 ++-- account_financial_report_webkit/report/open_invoices.py | 4 ++-- account_financial_report_webkit/report/partner_balance.py | 4 ++-- account_financial_report_webkit/report/partners_ledger.py | 4 ++-- account_financial_report_webkit/report/print_journal.py | 4 ++-- account_financial_report_webkit/report/trial_balance.py | 4 ++-- .../report/webkit_parser_header_fix.py | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/account_financial_report_webkit/report/aged_open_invoices.py b/account_financial_report_webkit/report/aged_open_invoices.py index 2404f774..96c78374 100644 --- a/account_financial_report_webkit/report/aged_open_invoices.py +++ b/account_financial_report_webkit/report/aged_open_invoices.py @@ -23,7 +23,7 @@ from __future__ import division from datetime import datetime -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools.translate import _ from .open_invoices import PartnersOpenInvoicesWebkit @@ -76,7 +76,7 @@ class AccountAgedOpenInvoicesWebkit(PartnersOpenInvoicesWebkit): refer to :class:`openerp.report.report_sxw.rml_parse`""" super(AccountAgedOpenInvoicesWebkit, self).__init__(cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id diff --git a/account_financial_report_webkit/report/aged_partner_balance.py b/account_financial_report_webkit/report/aged_partner_balance.py index 1f640c14..a9de9ca9 100644 --- a/account_financial_report_webkit/report/aged_partner_balance.py +++ b/account_financial_report_webkit/report/aged_partner_balance.py @@ -21,7 +21,7 @@ from __future__ import division from datetime import datetime -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools.translate import _ from .open_invoices import PartnersOpenInvoicesWebkit @@ -74,7 +74,7 @@ class AccountAgedTrialBalanceWebkit(PartnersOpenInvoicesWebkit): refer to :class:`openerp.report.report_sxw.rml_parse`""" super(AccountAgedTrialBalanceWebkit, self).__init__(cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id diff --git a/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py index df7e60bf..b91273c8 100644 --- a/account_financial_report_webkit/report/general_ledger.py +++ b/account_financial_report_webkit/report/general_ledger.py @@ -24,7 +24,7 @@ from itertools import groupby from datetime import datetime from openerp.report import report_sxw -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.tools.translate import _ from .common_reports import CommonReportHeaderWebkit from .webkit_parser_header_fix import HeaderFooterTextWebKitParser @@ -35,7 +35,7 @@ class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): def __init__(self, cursor, uid, name, context): super(GeneralLedgerWebkit, self).__init__( cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse( diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index 99fe23e3..07fd92e7 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -26,7 +26,7 @@ from operator import itemgetter from mako.template import Template -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.osv import osv from openerp.report import report_sxw from openerp.tools.translate import _ @@ -50,7 +50,7 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, def __init__(self, cursor, uid, name, context): super(PartnersOpenInvoicesWebkit, self).__init__( cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse( diff --git a/account_financial_report_webkit/report/partner_balance.py b/account_financial_report_webkit/report/partner_balance.py index f836be6c..95a2787d 100644 --- a/account_financial_report_webkit/report/partner_balance.py +++ b/account_financial_report_webkit/report/partner_balance.py @@ -22,7 +22,7 @@ from datetime import datetime -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.report import report_sxw from openerp.tools.translate import _ from .common_partner_balance_reports \ @@ -36,7 +36,7 @@ class PartnerBalanceWebkit(report_sxw.rml_parse, def __init__(self, cursor, uid, name, context): super(PartnerBalanceWebkit, self).__init__( cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse( diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index dc0eeed6..7ddca6b5 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -22,7 +22,7 @@ from collections import defaultdict from datetime import datetime -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.osv import osv from openerp.report import report_sxw from openerp.tools.translate import _ @@ -36,7 +36,7 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, def __init__(self, cursor, uid, name, context): super(PartnersLedgerWebkit, self).__init__( cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse( diff --git a/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py index 3c6f8e1f..3ef7d439 100755 --- a/account_financial_report_webkit/report/print_journal.py +++ b/account_financial_report_webkit/report/print_journal.py @@ -25,7 +25,7 @@ from openerp.report import report_sxw from openerp.tools.translate import _ -from openerp import pooler +from openerp.modules.registry import RegistryManager from datetime import datetime from .common_reports import CommonReportHeaderWebkit @@ -37,7 +37,7 @@ class PrintJournalWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): def __init__(self, cursor, uid, name, context): super(PrintJournalWebkit, self).__init__(cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company_obj = self.pool.get('res.company') diff --git a/account_financial_report_webkit/report/trial_balance.py b/account_financial_report_webkit/report/trial_balance.py index e663fa53..8c86659d 100644 --- a/account_financial_report_webkit/report/trial_balance.py +++ b/account_financial_report_webkit/report/trial_balance.py @@ -22,7 +22,7 @@ from datetime import datetime -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp.report import report_sxw from openerp.tools.translate import _ from .common_balance_reports import CommonBalanceReportHeaderWebkit @@ -39,7 +39,7 @@ class TrialBalanceWebkit(report_sxw.rml_parse, def __init__(self, cursor, uid, name, context): super(TrialBalanceWebkit, self).__init__(cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) + self.pool = RegistryManager.get(self.cr.dbname) self.cursor = self.cr company = self.pool.get('res.users').browse(self.cr, uid, uid, 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 9484aaf0..e2a45941 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -40,7 +40,7 @@ from functools import partial from mako import exceptions from openerp.osv.orm import except_orm from openerp.tools.translate import _ -from openerp import pooler +from openerp.modules.registry import RegistryManager from openerp import tools from openerp.addons.report_webkit import webkit_report from openerp.addons.report_webkit.report_helper import WebKitHelper @@ -199,7 +199,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): self.name2, context=context) - self.pool = pooler.get_pool(cursor.dbname) + self.pool = RegistryManager.get(cursor.dbname) objs = self.getObjects(cursor, uid, ids, context) parser_instance.set_context(objs, data, ids, report_xml.report_type) From f4ea16ec58157cea9145b7b46b0419df6b3e0e2f Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 6 Jul 2017 16:56:58 +0200 Subject: [PATCH 2/3] [DEL] nonexistent fields --- .../test/partner_ledger.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/account_financial_report_webkit/test/partner_ledger.yml b/account_financial_report_webkit/test/partner_ledger.yml index 459bc7bf..641de8c6 100644 --- a/account_financial_report_webkit/test/partner_ledger.yml +++ b/account_financial_report_webkit/test/partner_ledger.yml @@ -4,7 +4,7 @@ !python {model: account.account}: | from datetime import datetime ctx={} - data_dict = {'chart_account_id':ref('account.chart0'), 'until_date': '%s-12-31' %(datetime.now().year)} + data_dict = {'chart_account_id':ref('account.chart0')} 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') @@ -15,7 +15,7 @@ from datetime import datetime ctx={} 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', + 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier'} 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') @@ -27,7 +27,7 @@ from datetime import datetime ctx={} 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', + 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'partner_ids': [ref('base.res_partner_2'), ref('base.res_partner_1')]} from openerp.tools import test_reports @@ -40,7 +40,7 @@ from datetime import datetime ctx={} 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', + '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 openerp.tools import test_reports @@ -53,7 +53,7 @@ from datetime import datetime ctx={} 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', + '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 openerp.tools import test_reports From 24a117474a02fb83629886c928e928e9c462a951 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Sat, 8 Jul 2017 07:39:36 +0200 Subject: [PATCH 3/3] [DEL] more nonexistent fields --- .../tests/partner_ledger.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/account_financial_report_webkit_xls/tests/partner_ledger.yml b/account_financial_report_webkit_xls/tests/partner_ledger.yml index 4a25dcd7..0a1dd6e7 100644 --- a/account_financial_report_webkit_xls/tests/partner_ledger.yml +++ b/account_financial_report_webkit_xls/tests/partner_ledger.yml @@ -4,7 +4,7 @@ !python {model: account.account}: | from datetime import datetime ctx={'xls_export':1} - data_dict = {'chart_account_id':ref('account.chart0'), 'until_date': '%s-12-31' %(datetime.now().year)} + data_dict = {'chart_account_id':ref('account.chart0')} from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export',our_module='account_financial_report_webkit_xls') @@ -15,7 +15,7 @@ from datetime import datetime ctx={'xls_export':1} 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', + 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier'} from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_partners_ledger_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export',our_module='account_financial_report_webkit_xls') @@ -27,7 +27,7 @@ from datetime import datetime ctx={'xls_export':1} 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', + 'target_move': 'posted', 'amount_currency': True, 'result_selection': 'customer_supplier', 'partner_ids': [ref('base.res_partner_2'), ref('base.res_partner_1')]} from openerp.tools import test_reports @@ -40,7 +40,7 @@ from datetime import datetime ctx={'xls_export':1} 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', + '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 openerp.tools import test_reports @@ -53,7 +53,7 @@ from datetime import datetime ctx={'xls_export':1} 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', + '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 openerp.tools import test_reports