Merge lp:~joao-gama/openerp-mgmtsystem/6.1-bug-1090581-mgmtsystem_audit into lp:openerp-mgmtsystem/6.1

Proposed by Joao Alfredo Gama Batista
Status: Merged
Merged at revision: 29
Proposed branch: lp:~joao-gama/openerp-mgmtsystem/6.1-bug-1090581-mgmtsystem_audit
Merge into: lp:openerp-mgmtsystem/6.1
Diff against target: 86 lines (+15/-14)
2 files modified
mgmtsystem_audit/report/verification_list.py (+14/-11)
mgmtsystem_audit/report/verification_list.rml (+1/-3)
To merge this branch: bzr merge lp:~joao-gama/openerp-mgmtsystem/6.1-bug-1090581-mgmtsystem_audit
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) Approve
Alexandre Fayolle - camptocamp code review, no test Pending
Review via email: mp+140787@code.launchpad.net

This proposal supersedes a proposal from 2012-12-17.

Description of the change

The Verification List report is now translatable.

To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : Posted in a previous version of this proposal

LGTM.

Additional note: on line 42, you may want to mark the "Yes / No" string as translatable.

review: Approve (code review, no test)
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote : Posted in a previous version of this proposal

Make yes_no translatable as suggested.

review: Needs Fixing
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mgmtsystem_audit/report/verification_list.py'
2--- mgmtsystem_audit/report/verification_list.py 2012-05-04 22:50:44 +0000
3+++ mgmtsystem_audit/report/verification_list.py 2012-12-19 23:24:23 +0000
4@@ -1,6 +1,6 @@
5 # -*- encoding: utf-8 -*-
6 ##############################################################################
7-#
8+#
9 # OpenERP, Open Source Management Solution
10 # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
11 #
12@@ -15,12 +15,13 @@
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16-# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #
19 ##############################################################################
20
21 import time
22 from report import report_sxw
23+from tools.translate import _
24
25 class mgmtsystem_audit_verification_list(report_sxw.rml_parse):
26 def __init__(self, cr, uid, name, context):
27@@ -35,12 +36,16 @@
28 v = {}
29 p = []
30 for l in verification_lines:
31- proc_nm = self.pool.get('wiki.wiki').read(self.cr, self.uid, l.procedure_id.id, ['name'])
32+ if l.procedure_id:
33+ proc_nm = self.pool.get('wiki.wiki').read(self.cr, self.uid, l.procedure_id.id, ['name'])['name']
34+ else:
35+ proc_nm = ''
36+
37 p.append({"id": l.id,
38- "procedure": proc_nm['name'],
39+ "procedure": proc_nm,
40 "name": l.name,
41- "yes_no": "Yes / No"})
42-
43+ "yes_no": _('Yes / No')})
44+
45 p = sorted(p, key=lambda k: k["procedure"])
46
47 proc_line = False
48@@ -49,7 +54,7 @@
49 for i in range(len(p)):
50 if proc_name != p[i]['procedure']:
51 proc_line = True
52-
53+
54 if proc_line:
55 q.append({"id": p[i]['id'],
56 "procedure": p[i]['procedure'],
57@@ -61,12 +66,10 @@
58 q.append({"id": p[i]['id'],
59 "procedure": "",
60 "name": p[i]['name'],
61- "yes_no": "Yes / No"})
62-
63-
64+ "yes_no": _('Yes / No')})
65
66 return q
67-
68+
69 report_sxw.report_sxw(
70 'report.mgmtsystem.audit.verificationlist',
71 'mgmtsystem.audit',
72
73=== modified file 'mgmtsystem_audit/report/verification_list.rml'
74--- mgmtsystem_audit/report/verification_list.rml 2012-05-04 22:50:44 +0000
75+++ mgmtsystem_audit/report/verification_list.rml 2012-12-19 23:24:23 +0000
76@@ -72,9 +72,7 @@
77 </blockTable>
78 </pto_header>
79 <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
80- <para style="terp_default_8">
81- <font color="white"> </font>
82- </para>
83+ <para style="terp_default_8">[[ setLang(user.context_lang) ]]</para>
84 <para style="terp_header_Centre">Verification List</para>
85 <para style="terp_header_Centre">[[ o.name ]]</para>
86 <para style="terp_default_8">

Subscribers

People subscribed via source and target branches