Merge lp:~camptocamp/hr-timesheet/7.0-hr_timesheet_print-migr into lp:~hr-core-editors/hr-timesheet/7.0
- 7.0-hr_timesheet_print-migr
- Merge into 7.0
Proposed by
Guewen Baconnier @ Camptocamp
Status: | Merged |
---|---|
Merge reported by: | Joël Grand-Guillaume @ camptocamp |
Merged at revision: | not available |
Proposed branch: | lp:~camptocamp/hr-timesheet/7.0-hr_timesheet_print-migr |
Merge into: | lp:~hr-core-editors/hr-timesheet/7.0 |
Diff against target: |
537 lines (+168/-199) 6 files modified
hr_timesheet_print/__init__.py (+16/-22) hr_timesheet_print/__openerp__.py (+21/-25) hr_timesheet_print/report.xml (+2/-2) hr_timesheet_print/report/__init__.py (+20/-27) hr_timesheet_print/report/timesheet_report.py (+24/-36) hr_timesheet_print/report/timesheet_report.rml (+85/-87) |
To merge this branch: | bzr merge lp:~camptocamp/hr-timesheet/7.0-hr_timesheet_print-migr |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandre Fayolle - camptocamp | code review, no test | Approve | |
Review via email: mp+139416@code.launchpad.net |
Commit message
[MIGR] migration of hr_timesheet_print to OpenERP 7.0
Description of the change
Migration of the module hr_timesheet_print to OpenERP version7.
Most of the changes are styling issues.
Corrected a wrong copyright attribution and changed the license to AGPLv3
To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
review:
Approve
(code review, no test)
- 44. By Guewen Baconnier @ Camptocamp <email address hidden>
-
[FIX] space after : for pep8 compliance
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Yes, the copyright was definitely a wrong attribution, certainly due to a heedless copy/paste.
Fixed the missing space after the ':' (which is effectively a PEP8 convention), I missed it.
You are right, all of them would also work on 6.x, I'm almost sure for 6.1 at least.
I'll propose another merge for the 6.1 branch.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
fine!
- 45. By Guewen Baconnier @ Camptocamp <email address hidden>
-
[MRG] from lp:hr-timesheet/7.0
- 46. By Guewen Baconnier @ Camptocamp <email address hidden>
-
[MIGR] set installable to True
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'hr_timesheet_print/__init__.py' |
2 | --- hr_timesheet_print/__init__.py 2011-08-12 12:33:12 +0000 |
3 | +++ hr_timesheet_print/__init__.py 2012-12-13 12:26:19 +0000 |
4 | @@ -1,27 +1,21 @@ |
5 | -# -*- coding: utf-8 -*- |
6 | +# -*- coding: utf-8 -*- |
7 | ############################################################################## |
8 | # |
9 | -# @author Renaville Vincent, ported by Joel Grand-Guillaume |
10 | -# WARNING: This program as such is intended to be used by professional |
11 | -# programmers who take the whole responsability of assessing all potential |
12 | -# consequences resulting from its eventual inadequacies and bugs |
13 | -# End users who are looking for a ready-to-use solution with commercial |
14 | -# garantees and support are strongly adviced to contract a Free Software |
15 | -# Service Company |
16 | -# |
17 | -# This program is Free Software; you can redistribute it and/or |
18 | -# modify it under the terms of the GNU General Public License |
19 | -# as published by the Free Software Foundation; either version 2 |
20 | -# of the License, or (at your option) any later version. |
21 | -# |
22 | -# This program is distributed in the hope that it will be useful, |
23 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 | -# GNU General Public License for more details. |
26 | -# |
27 | -# You should have received a copy of the GNU General Public License |
28 | -# along with this program; if not, write to the Free Software |
29 | -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
30 | +# Author: Vincent Renaville |
31 | +# Copyright 2012 Camptocamp SA |
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 | +# published by the Free Software Foundation, either version 3 of the |
36 | +# License, or (at your option) any later version. |
37 | +# |
38 | +# This program is distributed in the hope that it will be useful, |
39 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
40 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
41 | +# GNU Affero General Public License for more details. |
42 | +# |
43 | +# You should have received a copy of the GNU Affero General Public License |
44 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
45 | # |
46 | ############################################################################## |
47 | import report |
48 | |
49 | === modified file 'hr_timesheet_print/__openerp__.py' |
50 | --- hr_timesheet_print/__openerp__.py 2012-12-13 12:20:12 +0000 |
51 | +++ hr_timesheet_print/__openerp__.py 2012-12-13 12:26:19 +0000 |
52 | @@ -1,26 +1,21 @@ |
53 | -# -*- coding: utf-8 -*- |
54 | +# -*- coding: utf-8 -*- |
55 | ############################################################################## |
56 | -## @author Bessi Nicolas, ported by Joel Grand-Guillaume |
57 | -# WARNING: This program as such is intended to be used by professional |
58 | -# programmers who take the whole responsability of assessing all potential |
59 | -# consequences resulting from its eventual inadequacies and bugs |
60 | -# End users who are looking for a ready-to-use solution with commercial |
61 | -# garantees and support are strongly adviced to contract a Free Software |
62 | -# Service Company |
63 | -# |
64 | -# This program is Free Software; you can redistribute it and/or |
65 | -# modify it under the terms of the GNU General Public License |
66 | -# as published by the Free Software Foundation; either version 2 |
67 | -# of the License, or (at your option) any later version. |
68 | -# |
69 | -# This program is distributed in the hope that it will be useful, |
70 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
71 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
72 | -# GNU General Public License for more details. |
73 | -# |
74 | -# You should have received a copy of the GNU General Public License |
75 | -# along with this program; if not, write to the Free Software |
76 | -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
77 | +# |
78 | +# Author: Nicolas Bessi, ported by Joel Grand-Guillaume |
79 | +# Copyright 2012 Camptocamp SA |
80 | +# |
81 | +# This program is free software: you can redistribute it and/or modify |
82 | +# it under the terms of the GNU Affero General Public License as |
83 | +# published by the Free Software Foundation, either version 3 of the |
84 | +# License, or (at your option) any later version. |
85 | +# |
86 | +# This program is distributed in the hope that it will be useful, |
87 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
88 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
89 | +# GNU Affero General Public License for more details. |
90 | +# |
91 | +# You should have received a copy of the GNU Affero General Public License |
92 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
93 | # |
94 | ############################################################################## |
95 | |
96 | @@ -31,18 +26,19 @@ |
97 | detailed of hours passed. |
98 | |
99 | """, |
100 | - "version" : "1.2", |
101 | + "version" : "1.3", |
102 | "author" : "Camptocamp", |
103 | "category" : "Generic Modules/Projects & Services", |
104 | "website": "http://www.camptocamp.com", |
105 | + "license": 'AGPL-3', |
106 | "depends" : [ |
107 | "analytic", |
108 | - "hr_timesheet", |
109 | + "hr_timesheet_invoice", |
110 | ], |
111 | "init_xml" : [], |
112 | "update_xml" : [ |
113 | "report.xml", |
114 | ], |
115 | "active": False, |
116 | - 'installable': False |
117 | + 'installable': True |
118 | } |
119 | |
120 | === modified file 'hr_timesheet_print/report.xml' |
121 | --- hr_timesheet_print/report.xml 2011-08-12 12:33:12 +0000 |
122 | +++ hr_timesheet_print/report.xml 2012-12-13 12:26:19 +0000 |
123 | @@ -3,13 +3,13 @@ |
124 | <data> |
125 | |
126 | <report id="timesheet_hours_report" |
127 | - string="Timesheet report" |
128 | + string="Timesheet Report" |
129 | model="hr.analytic.timesheet" |
130 | name="hr.analytic.timesheet.report" |
131 | rml="hr_timesheet_print/report/timesheet_report.rml"/> |
132 | |
133 | <report id="timesheet_hours_report_aal" |
134 | - string="Timesheet report" |
135 | + string="Timesheet Report" |
136 | model="account.analytic.line" |
137 | name="analytic.line.timesheet.report" |
138 | rml="hr_timesheet_print/report/timesheet_report.rml"/> |
139 | |
140 | === modified file 'hr_timesheet_print/report/__init__.py' |
141 | --- hr_timesheet_print/report/__init__.py 2011-08-12 12:33:12 +0000 |
142 | +++ hr_timesheet_print/report/__init__.py 2012-12-13 12:26:19 +0000 |
143 | @@ -1,27 +1,20 @@ |
144 | -# -*- encoding: utf-8 -*- |
145 | -############################################################################## |
146 | -# |
147 | -# |
148 | -# WARNING: This program as such is intended to be used by professional |
149 | -# programmers who take the whole responsability of assessing all potential |
150 | -# consequences resulting from its eventual inadequacies and bugs |
151 | -# End users who are looking for a ready-to-use solution with commercial |
152 | -# garantees and support are strongly adviced to contract a Free Software |
153 | -# Service Company |
154 | -# |
155 | -# This program is Free Software; you can redistribute it and/or |
156 | -# modify it under the terms of the GNU General Public License |
157 | -# as published by the Free Software Foundation; either version 2 |
158 | -# of the License, or (at your option) any later version. |
159 | -# |
160 | -# This program is distributed in the hope that it will be useful, |
161 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
162 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
163 | -# GNU General Public License for more details. |
164 | -# |
165 | -# You should have received a copy of the GNU General Public License |
166 | -# along with this program; if not, write to the Free Software |
167 | -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
168 | -# |
169 | -############################################################################## |
170 | -import timesheet_report |
171 | \ No newline at end of file |
172 | +# -*- coding: utf-8 -*- |
173 | +############################################################################## |
174 | +# |
175 | +# Copyright 2012 Camptocamp SA |
176 | +# |
177 | +# This program is free software: you can redistribute it and/or modify |
178 | +# it under the terms of the GNU Affero General Public License as |
179 | +# published by the Free Software Foundation, either version 3 of the |
180 | +# License, or (at your option) any later version. |
181 | +# |
182 | +# This program is distributed in the hope that it will be useful, |
183 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
184 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
185 | +# GNU Affero General Public License for more details. |
186 | +# |
187 | +# You should have received a copy of the GNU Affero General Public License |
188 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
189 | +# |
190 | +############################################################################## |
191 | +import timesheet_report |
192 | |
193 | === modified file 'hr_timesheet_print/report/timesheet_report.py' |
194 | --- hr_timesheet_print/report/timesheet_report.py 2011-09-23 08:28:16 +0000 |
195 | +++ hr_timesheet_print/report/timesheet_report.py 2012-12-13 12:26:19 +0000 |
196 | @@ -1,39 +1,30 @@ |
197 | +# -*- coding: utf-8 -*- |
198 | ############################################################################## |
199 | # |
200 | -# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. |
201 | -# |
202 | -# WARNING: This program as such is intended to be used by professional |
203 | -# programmers who take the whole responsability of assessing all potential |
204 | -# consequences resulting from its eventual inadequacies and bugs |
205 | -# End users who are looking for a ready-to-use solution with commercial |
206 | -# garantees and support are strongly adviced to contract a Free Software |
207 | -# Service Company |
208 | -# |
209 | -# This program is Free Software; you can redistribute it and/or |
210 | -# modify it under the terms of the GNU General Public License |
211 | -# as published by the Free Software Foundation; either version 2 |
212 | -# of the License, or (at your option) any later version. |
213 | -# |
214 | -# This program is distributed in the hope that it will be useful, |
215 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
216 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
217 | -# GNU General Public License for more details. |
218 | -# |
219 | -# You should have received a copy of the GNU General Public License |
220 | -# along with this program; if not, write to the Free Software |
221 | -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
222 | +# Copyright 2012 Camptocamp SA |
223 | +# |
224 | +# This program is free software: you can redistribute it and/or modify |
225 | +# it under the terms of the GNU Affero General Public License as |
226 | +# published by the Free Software Foundation, either version 3 of the |
227 | +# License, or (at your option) any later version. |
228 | +# |
229 | +# This program is distributed in the hope that it will be useful, |
230 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
231 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
232 | +# GNU Affero General Public License for more details. |
233 | +# |
234 | +# You should have received a copy of the GNU Affero General Public License |
235 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
236 | # |
237 | ############################################################################## |
238 | |
239 | import time |
240 | -from datetime import * |
241 | -from report import report_sxw |
242 | - |
243 | -#import xml.dom.minidom |
244 | -#import re |
245 | +from datetime import datetime |
246 | +from openerp.report import report_sxw |
247 | |
248 | |
249 | class timesheet_report(report_sxw.rml_parse): |
250 | + |
251 | def __init__(self, cr, uid, name, context=None): |
252 | super(timesheet_report, self).__init__(cr, uid, name, context) |
253 | self.localcontext.update({ |
254 | @@ -42,11 +33,11 @@ |
255 | }) |
256 | self.context = context |
257 | |
258 | - def set_context(self, objects, data, ids, report_type = None): |
259 | - super(timesheet_report,self).set_context(objects,data,ids,report_type) |
260 | + def set_context(self, objects, data, ids, report_type=None): |
261 | self.localcontext['ts_lines'] = objects |
262 | self.localcontext['tot_hours'] = self._get_tot_hours(objects) |
263 | - |
264 | + super(timesheet_report, self).set_context(objects, data, ids, report_type) |
265 | + |
266 | def _get_tot_hours(self, ts_lines): |
267 | tot = 0.0 |
268 | deduced = 0.0 |
269 | @@ -60,22 +51,19 @@ |
270 | factor_invoicing = 1.0 |
271 | if line.to_invoice and line.to_invoice.factor != 0.0: |
272 | factor_invoicing = 1.0 - line.to_invoice.factor / 100 |
273 | - # deduced += ((line.unit_amount / factor) * factor_invoicing) |
274 | if factor_invoicing > 1.0: |
275 | deduced += ((line.unit_amount / factor) * factor_invoicing) |
276 | tot += ((line.unit_amount / factor) * factor_invoicing) |
277 | elif factor_invoicing <= 1.0: |
278 | tot += (line.unit_amount / factor) |
279 | deduced += ((line.unit_amount / factor) * factor_invoicing) |
280 | - |
281 | - |
282 | - return {'total':tot,'deduced':deduced} |
283 | - |
284 | + |
285 | + return {'total': tot, 'deduced': deduced} |
286 | |
287 | def _get_and_change_date_format_for_swiss(self, date_to_format): |
288 | date_formatted = '' |
289 | if date_to_format: |
290 | - date_formatted = strptime(date_to_format, '%Y-%m-%d').strftime('%d.%m.%Y') |
291 | + date_formatted = datetime.strptime(date_to_format, '%Y-%m-%d').strftime('%d.%m.%Y') |
292 | return date_formatted |
293 | |
294 | report_sxw.report_sxw('report.hr.analytic.timesheet.report', 'hr.analytic.timesheet', 'addons/hr_timesheet_print/report/timesheet_report.rml', parser=timesheet_report) |
295 | |
296 | === modified file 'hr_timesheet_print/report/timesheet_report.rml' |
297 | --- hr_timesheet_print/report/timesheet_report.rml 2011-08-12 12:33:12 +0000 |
298 | +++ hr_timesheet_print/report/timesheet_report.rml 2012-12-13 12:26:19 +0000 |
299 | @@ -1,22 +1,22 @@ |
300 | <?xml version="1.0"?> |
301 | <document filename="test.pdf"> |
302 | - <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
303 | + <template pageSize="(595.0,842.0)" title="Timesheet Report" author="" allowSplitting="20"> |
304 | <pageTemplate id="first"> |
305 | <frame id="first" x1="35.0" y1="35.0" width="525" height="772"/> |
306 | - <pageGraphics> |
307 | - <setFont name="Helvetica-Bold" size="9"/> |
308 | - |
309 | - <drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString> |
310 | - <drawString x="17.7cm" y="28.1cm">Maintenance And Support Summary</drawString> |
311 | - |
312 | - <setFont name="Helvetica" size="9"/> |
313 | - <drawString x="1.0cm" y="2cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString> |
314 | - <drawString x="17.7cm" y="2cm">Page <pageNumber/></drawString> |
315 | - |
316 | - <lineMode width="0.7"/> |
317 | - <lines>0.6cm 27.9cm 20.3cm 27.9cm</lines> |
318 | - <setFont name="Helvetica" size="8"/> |
319 | - </pageGraphics> |
320 | + <pageGraphics> |
321 | + <setFont name="Helvetica-Bold" size="9"/> |
322 | + |
323 | + <drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString> |
324 | + <drawString x="17.7cm" y="28.1cm">Maintenance And Support Summary</drawString> |
325 | + |
326 | + <setFont name="Helvetica" size="9"/> |
327 | + <drawString x="1.0cm" y="2cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString> |
328 | + <drawString x="17.7cm" y="2cm">Page <pageNumber/></drawString> |
329 | + |
330 | + <lineMode width="0.7"/> |
331 | + <lines>0.6cm 27.9cm 20.3cm 27.9cm</lines> |
332 | + <setFont name="Helvetica" size="8"/> |
333 | + </pageGraphics> |
334 | |
335 | </pageTemplate> |
336 | </template> |
337 | @@ -26,7 +26,7 @@ |
338 | <blockValign value="TOP"/> |
339 | </blockTableStyle> |
340 | <blockTableStyle id="Table1"> |
341 | - <lineStyle kind="LINEBELOW" colorName="#ffffff" start="0,0" stop="-1,-1"/> |
342 | + <lineStyle kind="LINEBELOW" colorName="#ffffff" start="0,0" stop="-1,-1"/> |
343 | <blockAlignment value="LEFT"/> |
344 | <blockValign value="TOP"/> |
345 | <blockBackground colorName="#e6e6e6" start="0,0" stop="0,-1"/> |
346 | @@ -35,7 +35,7 @@ |
347 | <blockBackground colorName="#e6e6e6" start="0,1" stop="0,-1"/> |
348 | <blockBackground colorName="#e6e6e6" start="1,1" stop="1,-1"/> |
349 | <blockBackground colorName="#e6e6e6" start="2,1" stop="2,-1"/> |
350 | - |
351 | + |
352 | </blockTableStyle> |
353 | <blockTableStyle id="Table6"> |
354 | <blockAlignment value="LEFT"/> |
355 | @@ -57,7 +57,7 @@ |
356 | <blockTableStyle id="Table2"> |
357 | <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/> |
358 | <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/> |
359 | - |
360 | + |
361 | <blockValign value="TOP"/> |
362 | <blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/> |
363 | </blockTableStyle> |
364 | @@ -85,7 +85,7 @@ |
365 | <blockTableStyle id="Table7"> |
366 | <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/> |
367 | </blockTableStyle> |
368 | - |
369 | + |
370 | <initialize> |
371 | <paraStyle name="all" alignment="justify"/> |
372 | </initialize> |
373 | @@ -94,7 +94,7 @@ |
374 | <paraStyle name="P2c" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/> |
375 | <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> |
376 | <paraStyle name="P10" fontName="Helvetica" fontSize="8.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/> |
377 | - <paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="14.5" leftIndent="-5.0"/> |
378 | + <paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="14.5" leftIndent="-5.0"/> |
379 | <paraStyle name="P9b" fontName="Helvetica" fontSize="8" alignment="LEFT"/> |
380 | <paraStyle name="P9c" fontName="Helvetica" fontSize="8" alignment="RIGHT"/> |
381 | <paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/> |
382 | @@ -130,64 +130,62 @@ |
383 | </blockTableStyle> |
384 | |
385 | <paraStyle |
386 | - name="Level5" |
387 | - fontName="Helvetica" |
388 | - fontSize="8.0" /> |
389 | - <paraStyle |
390 | - name="Level4" |
391 | - fontName="Helvetica" |
392 | - fontSize="8.0" /> |
393 | - <paraStyle |
394 | - name="Level3" |
395 | - fontName="Helvetica" |
396 | - fontSize="8.0" /> |
397 | - <paraStyle |
398 | - name="Level2" |
399 | - firstLineIndent="-0.03cm" |
400 | - fontName="Helvetica-Bold" |
401 | - fontSize="8.0" /> |
402 | + name="Level5" |
403 | + fontName="Helvetica" |
404 | + fontSize="8.0" /> |
405 | + <paraStyle |
406 | + name="Level4" |
407 | + fontName="Helvetica" |
408 | + fontSize="8.0" /> |
409 | + <paraStyle |
410 | + name="Level3" |
411 | + fontName="Helvetica" |
412 | + fontSize="8.0" /> |
413 | + <paraStyle |
414 | + name="Level2" |
415 | + firstLineIndent="-0.03cm" |
416 | + fontName="Helvetica-Bold" |
417 | + fontSize="8.0" /> |
418 | <paraStyle name="Level1" |
419 | - fontSize="8.0" |
420 | - fontName="Helvetica-Bold" |
421 | - /> |
422 | + fontSize="8.0" |
423 | + fontName="Helvetica-Bold" |
424 | + /> |
425 | <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/> |
426 | <paraStyle name="Index" fontName="Helvetica"/> |
427 | </stylesheet> |
428 | <images/> |
429 | <story> |
430 | |
431 | - <para style="P2">[[ objects and objects[0] and setLang(objects[0].account_id.partner_id.lang) ]]</para> |
432 | - <para style="P1">Spent hours details</para> |
433 | - |
434 | + <para style="P2">[[ objects and objects[0] and setLang(objects[0].account_id.partner_id.lang) ]]</para> |
435 | + <para style="P1">Spent hours details</para> |
436 | + |
437 | <para style="P12a"></para> |
438 | <para style="P12a"></para> |
439 | <blockTable colWidths="258.0,259.0" style="Table1" repeatRows="1"> |
440 | - <tr> |
441 | - <td> |
442 | - <para style="P12a">Report Date : </para> |
443 | - </td> |
444 | - <td> |
445 | - <para style="P2">[[ time.strftime("%d.%m.%Y", time.localtime()) ]]</para> |
446 | - </td> |
447 | - </tr> |
448 | - <tr> |
449 | - <td> |
450 | - <!-- <para style="P12a">[[ o.type == 'hours' and "Quantity of hours" or "Amount"]] used : </para> --> |
451 | - <para style="P12a">Total hours : </para> |
452 | - </td> |
453 | - <td> |
454 | - <para style="P2">[[ round(tot_hours['total'],2) ]]</para> |
455 | - </td> |
456 | - </tr> |
457 | - <tr> |
458 | - <td> |
459 | - <!-- <para style="P12a">[[ o.type == 'hours' and "Quantity of hours" or "Amount"]] used : </para> --> |
460 | - <para style="P12a">Invoiced hours : </para> |
461 | - </td> |
462 | - <td> |
463 | - <para style="P2">[[ round(tot_hours['deduced'],2) or '0.0' ]]</para> |
464 | - </td> |
465 | - </tr> |
466 | + <tr> |
467 | + <td> |
468 | + <para style="P12a">Report Date: </para> |
469 | + </td> |
470 | + <td> |
471 | + <para style="P2">[[ time.strftime("%d.%m.%Y", time.localtime()) ]]</para> |
472 | + </td> |
473 | + </tr> |
474 | + <tr> |
475 | + <td> |
476 | + <para style="P12a">Total hours: </para> |
477 | + </td> |
478 | + <td> |
479 | + <para style="P2">[[ round(tot_hours['total'],2) ]]</para> |
480 | + </td> |
481 | + </tr> |
482 | + <tr> |
483 | + <td> |
484 | + <para style="P12a">Invoiced hours: </para> |
485 | + </td> |
486 | + <td> |
487 | + <para style="P2">[[ round(tot_hours['deduced'], 2) or '0.0' ]]</para> |
488 | + </td> |
489 | + </tr> |
490 | </blockTable> |
491 | <para style="P12a"></para> |
492 | <para style="P12a"></para> |
493 | @@ -210,25 +208,25 @@ |
494 | <para style="P12a">Deduced</para> |
495 | </td> |
496 | </tr> |
497 | - |
498 | - <tr> |
499 | - [[ repeatIn(objects,'l') ]] |
500 | - <td> |
501 | - <para style="P2">[[ l.date and format_date(l.date) or '' ]]</para> |
502 | - </td> |
503 | - <td> |
504 | - <para style="P2">[[ l.name or '' ]]</para> |
505 | - </td> |
506 | - <td> |
507 | - <para style="P2c">[[ round(l.to_invoice.factor >= 0.0 and l.unit_amount or l.to_invoice.factor <= -0.01 and l.unit_amount and ((l.unit_amount and l.to_invoice) and (l.unit_amount - (l.unit_amount * l.to_invoice.factor) / 100 ) or '0.0') or '0.0',2) ]]</para> |
508 | - </td> |
509 | - <td> |
510 | - <para style="P2c">[[ l.to_invoice.factor >= 0.0 and l.to_invoice.customer_name or l.to_invoice.factor <= -0.01 and '100%' ]]</para> |
511 | - </td> |
512 | - <td> |
513 | - <para style="P2c">[[ round((l.unit_amount and l.to_invoice) and (l.unit_amount - (l.unit_amount * l.to_invoice.factor) / 100 ) or '0.0', 2) ]]</para> |
514 | - </td> |
515 | - </tr> |
516 | + |
517 | + <tr> |
518 | + [[ repeatIn(objects, 'l') ]] |
519 | + <td> |
520 | + <para style="P2">[[ l.date and format_date(l.date) or '' ]]</para> |
521 | + </td> |
522 | + <td> |
523 | + <para style="P2">[[ l.name or '' ]]</para> |
524 | + </td> |
525 | + <td> |
526 | + <para style="P2c">[[ round(l.to_invoice.factor >= 0.0 and l.unit_amount or l.to_invoice.factor <= -0.01 and l.unit_amount and ((l.unit_amount and l.to_invoice) and (l.unit_amount - (l.unit_amount * l.to_invoice.factor) / 100 ) or 0.0), 2) or '0.0' ]]</para> |
527 | + </td> |
528 | + <td> |
529 | + <para style="P2c">[[ l.to_invoice.factor >= 0.0 and l.to_invoice.customer_name or l.to_invoice.factor <= -0.01 and '100%' ]]</para> |
530 | + </td> |
531 | + <td> |
532 | + <para style="P2c">[[ round((l.unit_amount and l.to_invoice) and (l.unit_amount - (l.unit_amount * l.to_invoice.factor) / 100 ) or 0.0, 2) or '0.0' ]]</para> |
533 | + </td> |
534 | + </tr> |
535 | </blockTable> |
536 | |
537 | </story> |
are you sure about the copyright assignment changes in the headers?
l279: I suggest adding a space after the ':' for enhanced readability and probably PEP8 compliance
Am I missing something or are all the changes here cleanups that would also work on 6.x ?