Merge lp:~luc-demeyer/openerp-reporting-engines/7.0-report_xls-tz_fix into lp:openerp-reporting-engines

Proposed by Luc De Meyer (Noviat)
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 5
Merged at revision: 5
Proposed branch: lp:~luc-demeyer/openerp-reporting-engines/7.0-report_xls-tz_fix
Merge into: lp:openerp-reporting-engines
Diff against target: 104 lines (+10/-9)
4 files modified
report_xls/__init__.py (+2/-2)
report_xls/__openerp__.py (+3/-3)
report_xls/report_xls.py (+3/-2)
report_xls/utils.py (+2/-2)
To merge this branch: bzr merge lp:~luc-demeyer/openerp-reporting-engines/7.0-report_xls-tz_fix
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no test Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+219267@code.launchpad.net

Description of the change

timezone fix

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM. I didn't know method context_timestamp! I write it down for future references.

Regards.

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

Cheers.

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'report_xls/__init__.py'
2--- report_xls/__init__.py 2014-01-06 22:22:39 +0000
3+++ report_xls/__init__.py 2014-05-12 20:58:22 +0000
4@@ -3,7 +3,7 @@
5 #
6 # OpenERP, Open Source Management Solution
7 #
8-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
9+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
10 #
11 # This program is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Affero General Public License as
13@@ -16,7 +16,7 @@
14 # GNU Affero General Public License for more details.
15 #
16 # You should have received a copy of the GNU Affero General Public License
17-# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+# along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20 ##############################################################################
21
22
23=== modified file 'report_xls/__openerp__.py'
24--- report_xls/__openerp__.py 2014-01-06 22:22:39 +0000
25+++ report_xls/__openerp__.py 2014-05-12 20:58:22 +0000
26@@ -3,7 +3,7 @@
27 #
28 # OpenERP, Open Source Management Solution
29 #
30-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
31+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
32 #
33 # This program is free software: you can redistribute it and/or modify
34 # it under the terms of the GNU Affero General Public License as
35@@ -16,7 +16,7 @@
36 # GNU Affero General Public License for more details.
37 #
38 # You should have received a copy of the GNU Affero General Public License
39-# along with this program. If not, see <http://www.gnu.org/licenses/>.
40+# along with this program. If not, see <http://www.gnu.org/licenses/>.
41 #
42 ##############################################################################
43 {
44@@ -67,7 +67,7 @@
45
46 Development assistance
47 ''''''''''''''''''''''
48-Contact info@noviat.com for help with the development of Excel reports in OpenERP, .
49+Contact info@noviat.com for help with the development of Excel reports in OpenERP.
50
51 """,
52 'depends': ['base'],
53
54=== modified file 'report_xls/report_xls.py'
55--- report_xls/report_xls.py 2014-01-06 22:22:39 +0000
56+++ report_xls/report_xls.py 2014-05-12 20:58:22 +0000
57@@ -24,6 +24,7 @@
58 from xlwt.Style import default_style
59 import cStringIO
60 from datetime import datetime
61+from openerp.osv.fields import datetime as datetime_field
62 from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
63 import inspect
64 from types import CodeType
65@@ -58,7 +59,6 @@
66 # TO DO: move parameters infra to configurable data
67
68 # header/footer
69- DT_FORMAT = '%Y-%m-%d %H:%M:%S'
70 hf_params = {
71 'font_size': 8,
72 'font_style': 'I', # B: Bold, I: Italic, U: Underline
73@@ -120,8 +120,9 @@
74 self.xls_headers = {
75 'standard': '',
76 }
77+ report_date = datetime_field.context_timestamp(cr, uid, datetime.now(), context).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
78 self.xls_footers = {
79- 'standard': ('&L&%(font_size)s&%(font_style)s' + datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT) +
80+ 'standard': ('&L&%(font_size)s&%(font_style)s' + report_date +
81 '&R&%(font_size)s&%(font_style)s&P / &N') % self.hf_params,
82 }
83 self.generate_xls_report(_p, _xs, data, objs, wb)
84
85=== modified file 'report_xls/utils.py'
86--- report_xls/utils.py 2014-01-06 22:22:39 +0000
87+++ report_xls/utils.py 2014-05-12 20:58:22 +0000
88@@ -3,7 +3,7 @@
89 #
90 # OpenERP, Open Source Management Solution
91 #
92-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
93+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
94 #
95 # This program is free software: you can redistribute it and/or modify
96 # it under the terms of the GNU Affero General Public License as
97@@ -16,7 +16,7 @@
98 # GNU Affero General Public License for more details.
99 #
100 # You should have received a copy of the GNU Affero General Public License
101-# along with this program. If not, see <http://www.gnu.org/licenses/>.
102+# along with this program. If not, see <http://www.gnu.org/licenses/>.
103 #
104 ##############################################################################
105

Subscribers

People subscribed via source and target branches