-
Notifications
You must be signed in to change notification settings - Fork 6
/
report.patch
70 lines (66 loc) · 2.63 KB
/
report.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
diff --git a/openacademy/__manifest__.py b/openacademy/__manifest__.py
index 2e09dc2..0326ffc 100644
--- a/openacademy/__manifest__.py
+++ b/openacademy/__manifest__.py
@@ -20,7 +20,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
- 'depends': ['base', 'board'],
+ 'depends': ['base', 'board', 'web'],
# always loaded
'data': [
diff --git a/openacademy/i18n/es.po b/openacademy/i18n/es.po
index 43d7738..32a13bd 100644
--- a/openacademy/i18n/es.po
+++ b/openacademy/i18n/es.po
@@ -436,3 +436,5 @@ msgstr "openacademy.wizard"
#: model:ir.ui.view,arch_db:openacademy.wizard_form_view
msgid "or"
msgstr "or"
+
+
diff --git a/openacademy/report.py b/openacademy/report.py
index b059633..c36712b 100644
--- a/openacademy/report.py
+++ b/openacademy/report.py
@@ -9,13 +9,20 @@ class ReportSession(models.AbstractModel):
_name = "report.openacademy.report_session_view"
@api.multi
- def render_html(self, docids, data=None):
- report_obj = self.env["report"]
- report = report_obj._get_report_from_name("openacademy.report_session")
- docargs = {
- "doc_ids": docids,
- "doc_model": report.model,
- "docs": self.env['openacademy.session'].browse(docids),
- "other_variable": 'other value',
+ def _get_report_values(self, docids, data=None):
+ # report_obj = self.env["report"]
+ # report = report_obj._get_report_from_name("openacademy.report_session")
+ # docargs = {
+ # "doc_ids": docids,
+ # "doc_model": report.model,
+ # "docs": self.env['openacademy.session'].browse(docids),
+ # "other_variable": 'other value',
+ # }
+ # return report_obj.render("openacademy.report_session_view", docargs)
+ docs = self.env['openacademy.session'].browse(docids)
+ return {
+ 'doc_ids': docs.ids,
+ 'doc_model': 'openacademy.session',
+ 'docs': docs,
+ 'other_variable': 'other value',
}
- return report_obj.render("openacademy.report_session_view", docargs)
diff --git a/openacademy/reports.xml b/openacademy/reports.xml
index 92a708e..21a2e05 100644
--- a/openacademy/reports.xml
+++ b/openacademy/reports.xml
@@ -9,7 +9,7 @@
<template id="report_session_view">
<t t-foreach="docs" t-as="doc">
- <t t-call="report.external_layout">
+ <t t-call="web.external_layout">
<div class="page">
<h2>Printed Date <span t-esc="datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')"/></h2>
<h2>Printed User <span t-esc="env.user.name"/></h2>