- %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]:
${account.code} - ${account.name} -- ${partner_name or _('No Partner')}
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 @@
${account.code} - ${account.name}
- %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')