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: Superseded
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) Needs Fixing
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+140317@code.launchpad.net

This proposal has been superseded by a proposal from 2012-12-19.

Description of the change

Check if the action line is linked with a procedure before try to reach the procedure.

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

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 :

Make yes_no translatable as suggested.

review: Needs Fixing
31. By Joao Alfredo Gama Batista

[IMP] Make the verification List report translatable

Unmerged revisions

Preview Diff

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

Subscribers

People subscribed via source and target branches