Merge lp:~openerp-dev/openobject-addons/7.0-opw-590139-ksa into lp:openobject-addons/7.0

Proposed by Kirti Savalia(OpenERP) on 2013-04-19
Status: Merged
Approved by: Naresh(OpenERP) on 2013-04-22
Approved revision: no longer in the source branch.
Merged at revision: 9240
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-590139-ksa
Merge into: lp:openobject-addons/7.0
Diff against target: 226 lines (+43/-26)
10 files modified
account/report/account_aged_partner_balance.py (+4/-3)
account/report/account_aged_partner_balance.rml (+5/-2)
account/report/account_balance.rml (+9/-3)
account/report/account_general_journal.rml (+2/-2)
account/report/account_general_ledger_landscape.rml (+5/-4)
account/report/account_journal.py (+4/-3)
account/report/account_journal.rml (+6/-4)
account/report/account_partner_ledger.py (+4/-3)
account/report/account_partner_ledger.rml (+3/-1)
account/wizard/account_report_common.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-590139-ksa
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) 2013-04-19 Approve on 2013-04-22
Kirti Savalia(OpenERP) (community) Resubmit on 2013-04-22
Review via email: mp+159758@code.launchpad.net

Description of the change

Hello,

Fixed the traslation related problem for the accout related report.

Thanks
KSA

To post a comment you must log in.
Naresh(OpenERP) (nch-openerp) wrote :

Needs proper fix by fixing the actual root

review: Needs Fixing

Hello,

Apply the changes according your given suggestion.

Thanks
KSA

review: Resubmit
review: Approve
Olivier Dony (Odoo) (odo-openerp) wrote :

Some remarks:
- some obvious translations were missing next to terms that were fixed (for example the 'Company' labels next to the 'Chart of Accounts' labels in headers => the same fix should have been applied directly).
- none of the .sxw files were updated with the same corrections done in the rml files - causing more desynchronization
- the call to _translate() in the report helpers was not working because it looks for translations of type RML/Report only, and this happens only when the terms appear in RML source, which was not the case. We can achieve the correct result by putting the terms in the RML directly (combined with removeParentNode()), so these Python helper methods are actually useless.

I fixed all of the above before merging, please pay attention to those details in the future, at least as long as we are using RML-based reports :-)

Thanks,

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/report/account_aged_partner_balance.py'
2--- account/report/account_aged_partner_balance.py 2012-12-06 14:56:32 +0000
3+++ account/report/account_aged_partner_balance.py 2013-06-14 21:43:25 +0000
4@@ -366,12 +366,13 @@
5 return period or 0.0
6
7 def _get_partners(self,data):
8+ # TODO: deprecated, to remove in trunk
9 if data['form']['result_selection'] == 'customer':
10- return 'Receivable Accounts'
11+ return self._translate('Receivable Accounts')
12 elif data['form']['result_selection'] == 'supplier':
13- return 'Payable Accounts'
14+ return self._translate('Payable Accounts')
15 elif data['form']['result_selection'] == 'customer_supplier':
16- return 'Receivable and Payable Accounts'
17+ return self._translate('Receivable and Payable Accounts')
18 return ''
19
20 report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
21
22=== modified file 'account/report/account_aged_partner_balance.rml'
23--- account/report/account_aged_partner_balance.rml 2011-09-21 23:46:12 +0000
24+++ account/report/account_aged_partner_balance.rml 2013-06-14 21:43:25 +0000
25@@ -147,7 +147,9 @@
26 <para style="terp_default_Centre_8">[[ data['form']['period_length'] ]]</para>
27 </td>
28 <td>
29- <para style="terp_default_Centre_8">[[ get_partners(data) ]]</para>
30+ <para style="terp_default_Centre_8">Receivable Accounts[[ data['form']['result_selection'] == 'customer' or removeParentNode('para') ]]</para>
31+ <para style="terp_default_Centre_8">Payable Accounts[[ data['form']['result_selection'] == 'supplier' or removeParentNode('para') ]]</para>
32+ <para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form']['result_selection'] == 'customer_supplier' or removeParentNode('para') ]]</para>
33 </td>
34 <td>
35 <para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>
36@@ -166,7 +168,8 @@
37 <para style="terp_tblheader_Details">Partners</para>
38 </td>
39 <td>
40- <para style="terp_tblheader_Details_Right">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]</para>
41+ <para style="terp_tblheader_Details_Right">Due[[ data['form']['direction_selection'] == 'future' and ' ' or removeParentNode('para') ]]</para>
42+ <para style="terp_tblheader_Details_Right">Not due[[ data['form']['direction_selection'] != 'future' and ' ' or removeParentNode('para') ]]</para>
43 </td>
44 <td>
45 <para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]</para>
46
47=== modified file 'account/report/account_aged_partner_balance.sxw'
48Binary files account/report/account_aged_partner_balance.sxw 2011-02-07 09:06:40 +0000 and account/report/account_aged_partner_balance.sxw 2013-06-14 21:43:25 +0000 differ
49=== modified file 'account/report/account_balance.rml'
50--- account/report/account_balance.rml 2011-12-21 09:08:11 +0000
51+++ account/report/account_balance.rml 2013-06-14 21:43:25 +0000
52@@ -211,8 +211,10 @@
53 </para>
54 <blockTable colWidths="130.0,80.0,100.0,140.0,90.0" style="Table8">
55 <tr>
56- <td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]]</para>
57- <para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
58+ <td>
59+ <para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
60+ <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para>
61+ </td>
62 <td>
63 <para style="terp_tblheader_General_Centre">Fiscal Year</para>
64 </td>
65@@ -233,7 +235,11 @@
66 <td>
67 <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
68 </td>
69- <td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
70+ <td>
71+ <para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
72+ <para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
73+ <para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
74+ </td>
75 <td> <para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
76 <blockTable colWidths="60.0,60.0" style="Table5">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
77 <tr>
78
79=== modified file 'account/report/account_balance.sxw'
80Binary files account/report/account_balance.sxw 2011-10-27 21:11:24 +0000 and account/report/account_balance.sxw 2013-06-14 21:43:25 +0000 differ
81=== modified file 'account/report/account_general_journal.rml'
82--- account/report/account_general_journal.rml 2011-12-21 09:08:11 +0000
83+++ account/report/account_general_journal.rml 2013-06-14 21:43:25 +0000
84@@ -220,8 +220,8 @@
85 </blockTable>
86 <blockTable colWidths="80.0,100,80.0,150.0,100.0" style="Table2">
87 <tr>
88- <td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]]</para>
89- <para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
90+ <td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period' and ' ' or removeParentNode('para') ]]</para>
91+ <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
92 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
93 <td><para style="terp_tblheader_General_Centre">Journals</para></td>
94 <td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
95
96=== modified file 'account/report/account_general_journal.sxw'
97Binary files account/report/account_general_journal.sxw 2011-10-27 21:11:24 +0000 and account/report/account_general_journal.sxw 2013-06-14 21:43:25 +0000 differ
98=== modified file 'account/report/account_general_ledger_landscape.rml'
99--- account/report/account_general_ledger_landscape.rml 2012-06-13 09:06:00 +0000
100+++ account/report/account_general_ledger_landscape.rml 2013-06-14 21:43:25 +0000
101@@ -360,9 +360,8 @@
102 <blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table1">
103 <tr>
104 <td>
105- <para style="terp_tblheader_General_Centre">[[ data['model']=='account.account' and 'Company' or removeParentNode('para') ]]</para>
106- <para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para>
107- </td>
108+ <para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
109+ <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
110 <td>
111 <para style="terp_tblheader_General_Centre">Fiscal Year</para>
112 </td>
113@@ -395,7 +394,9 @@
114 <para style="terp_default_Centre_7">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
115 </td>
116 <td>
117- <para style="terp_default_Centre_7">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para>
118+ <para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
119+ <para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
120+ <para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
121 </td>
122 <td>
123 <para style="terp_default_Centre_7">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]</para>
124
125=== modified file 'account/report/account_general_ledger_landscape.sxw'
126Binary files account/report/account_general_ledger_landscape.sxw 2011-10-27 21:11:24 +0000 and account/report/account_general_ledger_landscape.sxw 2013-06-14 21:43:25 +0000 differ
127=== modified file 'account/report/account_journal.py'
128--- account/report/account_journal.py 2012-12-06 14:56:32 +0000
129+++ account/report/account_journal.py 2013-06-14 21:43:25 +0000
130@@ -189,11 +189,12 @@
131 return data['form']['amount_currency']
132
133 def _get_sortby(self, data):
134+ # TODO: deprecated, to remove in trunk
135 if self.sort_selection == 'date':
136- return 'Date'
137+ return self._translate('Date')
138 elif self.sort_selection == 'ref':
139- return 'Reference Number'
140- return 'Date'
141+ return self._translate('Reference Number')
142+ return self._translate('Date')
143
144 report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header='external')
145 report_sxw.report_sxw('report.account.journal.period.print.sale.purchase', 'account.journal.period', 'addons/account/report/account_journal_sale_purchase.rml', parser=journal_print, header='external')
146
147=== modified file 'account/report/account_journal.rml'
148--- account/report/account_journal.rml 2012-02-06 12:33:34 +0000
149+++ account/report/account_journal.rml 2013-06-14 21:43:25 +0000
150@@ -186,8 +186,8 @@
151 </para>
152 <blockTable colWidths="85.0,80.0,80.0,120.0,70.0,100.0" style="Table2">
153 <tr>
154- <td><para style="terp_tblheader_General_Centre"> [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]]</para>
155- <para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
156+ <td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period'and ' ' or removeParentNode('para') ]]</para>
157+ <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
158 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
159 <td><para style="terp_tblheader_General_Centre">Journal</para></td>
160 <td><para style="terp_tblheader_General_Centre">Period</para></td>
161@@ -199,8 +199,10 @@
162 <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
163 <td><para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para></td>
164 <td><para style="terp_default_Centre_8">[[ o.period_id.name ]] </para></td>
165- <td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>
166- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
167+ <td>
168+ <para style="terp_default_Centre_8">Date[[ data['form'].get('sort_selection', 'date') == 'date' and ' ' or removeParentNode('para') ]]</para>
169+ <para style="terp_default_Centre_8">Reference Number[[ data['form'].get('sort_selection', 'date') == 'ref' and ' ' or removeParentNode('para') ]]</para>
170+ </td>
171 </tr>
172 </blockTable>
173 <para style="P9">
174
175=== modified file 'account/report/account_journal.sxw'
176Binary files account/report/account_journal.sxw 2011-10-27 21:11:24 +0000 and account/report/account_journal.sxw 2013-06-14 21:43:25 +0000 differ
177=== modified file 'account/report/account_partner_ledger.py'
178--- account/report/account_partner_ledger.py 2013-01-23 11:32:53 +0000
179+++ account/report/account_partner_ledger.py 2013-06-14 21:43:25 +0000
180@@ -267,12 +267,13 @@
181 return result_tmp + result_init
182
183 def _get_partners(self):
184+ # TODO: deprecated, to remove in trunk
185 if self.result_selection == 'customer':
186- return 'Receivable Accounts'
187+ return _('Receivable Accounts')
188 elif self.result_selection == 'supplier':
189- return 'Payable Accounts'
190+ return _('Payable Accounts')
191 elif self.result_selection == 'customer_supplier':
192- return 'Receivable and Payable Accounts'
193+ return _('Receivable and Payable Accounts')
194 return ''
195
196 def _sum_currency_amount_account(self, account, form):
197
198=== modified file 'account/report/account_partner_ledger.rml'
199--- account/report/account_partner_ledger.rml 2012-06-13 09:06:00 +0000
200+++ account/report/account_partner_ledger.rml 2013-06-14 21:43:25 +0000
201@@ -423,7 +423,9 @@
202 </para>
203 </td>
204 <td>
205- <para style="terp_default_Centre_8">[[ get_partners() ]]</para>
206+ <para style="terp_default_Centre_8">Receivable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer' or removeParentNode('para') ]]</para>
207+ <para style="terp_default_Centre_8">Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'supplier' or removeParentNode('para') ]]</para>
208+ <para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer_supplier' or removeParentNode('para') ]]</para>
209 </td>
210 <td>
211 <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
212
213=== modified file 'account/report/account_partner_ledger.sxw'
214Binary files account/report/account_partner_ledger.sxw 2011-10-27 21:11:24 +0000 and account/report/account_partner_ledger.sxw 2013-06-14 21:43:25 +0000 differ
215=== modified file 'account/wizard/account_report_common.py'
216--- account/wizard/account_report_common.py 2012-12-19 23:31:33 +0000
217+++ account/wizard/account_report_common.py 2013-06-14 21:43:25 +0000
218@@ -175,7 +175,7 @@
219 data['form'][field] = data['form'][field][0]
220 used_context = self._build_contexts(cr, uid, ids, data, context=context)
221 data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
222- data['form']['used_context'] = used_context
223+ data['form']['used_context'] = dict(used_context, lang=context.get('lang', 'en_US'))
224 return self._print_report(cr, uid, ids, data, context=context)
225
226 account_common_report()