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
=== modified file 'account/report/account_aged_partner_balance.py'
--- account/report/account_aged_partner_balance.py 2012-12-06 14:56:32 +0000
+++ account/report/account_aged_partner_balance.py 2013-06-14 21:43:25 +0000
@@ -366,12 +366,13 @@
366 return period or 0.0366 return period or 0.0
367367
368 def _get_partners(self,data):368 def _get_partners(self,data):
369 # TODO: deprecated, to remove in trunk
369 if data['form']['result_selection'] == 'customer':370 if data['form']['result_selection'] == 'customer':
370 return 'Receivable Accounts'371 return self._translate('Receivable Accounts')
371 elif data['form']['result_selection'] == 'supplier':372 elif data['form']['result_selection'] == 'supplier':
372 return 'Payable Accounts'373 return self._translate('Payable Accounts')
373 elif data['form']['result_selection'] == 'customer_supplier':374 elif data['form']['result_selection'] == 'customer_supplier':
374 return 'Receivable and Payable Accounts'375 return self._translate('Receivable and Payable Accounts')
375 return ''376 return ''
376377
377report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',378report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
378379
=== modified file 'account/report/account_aged_partner_balance.rml'
--- account/report/account_aged_partner_balance.rml 2011-09-21 23:46:12 +0000
+++ account/report/account_aged_partner_balance.rml 2013-06-14 21:43:25 +0000
@@ -147,7 +147,9 @@
147 <para style="terp_default_Centre_8">[[ data['form']['period_length'] ]]</para>147 <para style="terp_default_Centre_8">[[ data['form']['period_length'] ]]</para>
148 </td>148 </td>
149 <td>149 <td>
150 <para style="terp_default_Centre_8">[[ get_partners(data) ]]</para>150 <para style="terp_default_Centre_8">Receivable Accounts[[ data['form']['result_selection'] == 'customer' or removeParentNode('para') ]]</para>
151 <para style="terp_default_Centre_8">Payable Accounts[[ data['form']['result_selection'] == 'supplier' or removeParentNode('para') ]]</para>
152 <para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form']['result_selection'] == 'customer_supplier' or removeParentNode('para') ]]</para>
151 </td>153 </td>
152 <td>154 <td>
153 <para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>155 <para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>
@@ -166,7 +168,8 @@
166 <para style="terp_tblheader_Details">Partners</para>168 <para style="terp_tblheader_Details">Partners</para>
167 </td>169 </td>
168 <td>170 <td>
169 <para style="terp_tblheader_Details_Right">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]</para>171 <para style="terp_tblheader_Details_Right">Due[[ data['form']['direction_selection'] == 'future' and ' ' or removeParentNode('para') ]]</para>
172 <para style="terp_tblheader_Details_Right">Not due[[ data['form']['direction_selection'] != 'future' and ' ' or removeParentNode('para') ]]</para>
170 </td>173 </td>
171 <td>174 <td>
172 <para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]</para>175 <para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]</para>
173176
=== modified file 'account/report/account_aged_partner_balance.sxw'
174Binary 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 differ177Binary 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
=== modified file 'account/report/account_balance.rml'
--- account/report/account_balance.rml 2011-12-21 09:08:11 +0000
+++ account/report/account_balance.rml 2013-06-14 21:43:25 +0000
@@ -211,8 +211,10 @@
211 </para>211 </para>
212 <blockTable colWidths="130.0,80.0,100.0,140.0,90.0" style="Table8">212 <blockTable colWidths="130.0,80.0,100.0,140.0,90.0" style="Table8">
213 <tr>213 <tr>
214 <td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]]</para>214 <td>
215 <para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>215 <para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
216 <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para>
217 </td>
216 <td>218 <td>
217 <para style="terp_tblheader_General_Centre">Fiscal Year</para>219 <para style="terp_tblheader_General_Centre">Fiscal Year</para>
218 </td>220 </td>
@@ -233,7 +235,11 @@
233 <td>235 <td>
234 <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>236 <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
235 </td>237 </td>
236 <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>238 <td>
239 <para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
240 <para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
241 <para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
242 </td>
237 <td> <para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>243 <td> <para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
238 <blockTable colWidths="60.0,60.0" style="Table5">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]244 <blockTable colWidths="60.0,60.0" style="Table5">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
239 <tr>245 <tr>
240246
=== modified file 'account/report/account_balance.sxw'
241Binary 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 differ247Binary 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
=== modified file 'account/report/account_general_journal.rml'
--- account/report/account_general_journal.rml 2011-12-21 09:08:11 +0000
+++ account/report/account_general_journal.rml 2013-06-14 21:43:25 +0000
@@ -220,8 +220,8 @@
220 </blockTable>220 </blockTable>
221 <blockTable colWidths="80.0,100,80.0,150.0,100.0" style="Table2">221 <blockTable colWidths="80.0,100,80.0,150.0,100.0" style="Table2">
222 <tr>222 <tr>
223 <td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]]</para>223 <td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period' and ' ' or removeParentNode('para') ]]</para>
224 <para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>224 <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
225 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>225 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
226 <td><para style="terp_tblheader_General_Centre">Journals</para></td>226 <td><para style="terp_tblheader_General_Centre">Journals</para></td>
227 <td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>227 <td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
228228
=== modified file 'account/report/account_general_journal.sxw'
229Binary 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 differ229Binary 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
=== modified file 'account/report/account_general_ledger_landscape.rml'
--- account/report/account_general_ledger_landscape.rml 2012-06-13 09:06:00 +0000
+++ account/report/account_general_ledger_landscape.rml 2013-06-14 21:43:25 +0000
@@ -360,9 +360,8 @@
360 <blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table1">360 <blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table1">
361 <tr>361 <tr>
362 <td>362 <td>
363 <para style="terp_tblheader_General_Centre">[[ data['model']=='account.account' and 'Company' or removeParentNode('para') ]]</para>363 <para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
364 <para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para>364 <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
365 </td>
366 <td>365 <td>
367 <para style="terp_tblheader_General_Centre">Fiscal Year</para>366 <para style="terp_tblheader_General_Centre">Fiscal Year</para>
368 </td>367 </td>
@@ -395,7 +394,9 @@
395 <para style="terp_default_Centre_7">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>394 <para style="terp_default_Centre_7">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
396 </td>395 </td>
397 <td>396 <td>
398 <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>397 <para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
398 <para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
399 <para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
399 </td>400 </td>
400 <td>401 <td>
401 <para style="terp_default_Centre_7">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]</para>402 <para style="terp_default_Centre_7">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]</para>
402403
=== modified file 'account/report/account_general_ledger_landscape.sxw'
403Binary 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 differ404Binary 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
=== modified file 'account/report/account_journal.py'
--- account/report/account_journal.py 2012-12-06 14:56:32 +0000
+++ account/report/account_journal.py 2013-06-14 21:43:25 +0000
@@ -189,11 +189,12 @@
189 return data['form']['amount_currency']189 return data['form']['amount_currency']
190190
191 def _get_sortby(self, data):191 def _get_sortby(self, data):
192 # TODO: deprecated, to remove in trunk
192 if self.sort_selection == 'date':193 if self.sort_selection == 'date':
193 return 'Date'194 return self._translate('Date')
194 elif self.sort_selection == 'ref':195 elif self.sort_selection == 'ref':
195 return 'Reference Number'196 return self._translate('Reference Number')
196 return 'Date'197 return self._translate('Date')
197198
198report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header='external')199report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header='external')
199report_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')200report_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')
200201
=== modified file 'account/report/account_journal.rml'
--- account/report/account_journal.rml 2012-02-06 12:33:34 +0000
+++ account/report/account_journal.rml 2013-06-14 21:43:25 +0000
@@ -186,8 +186,8 @@
186 </para>186 </para>
187 <blockTable colWidths="85.0,80.0,80.0,120.0,70.0,100.0" style="Table2">187 <blockTable colWidths="85.0,80.0,80.0,120.0,70.0,100.0" style="Table2">
188 <tr>188 <tr>
189 <td><para style="terp_tblheader_General_Centre"> [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]]</para>189 <td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period'and ' ' or removeParentNode('para') ]]</para>
190 <para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>190 <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
191 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>191 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
192 <td><para style="terp_tblheader_General_Centre">Journal</para></td>192 <td><para style="terp_tblheader_General_Centre">Journal</para></td>
193 <td><para style="terp_tblheader_General_Centre">Period</para></td>193 <td><para style="terp_tblheader_General_Centre">Period</para></td>
@@ -199,8 +199,10 @@
199 <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>199 <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
200 <td><para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para></td>200 <td><para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para></td>
201 <td><para style="terp_default_Centre_8">[[ o.period_id.name ]] </para></td>201 <td><para style="terp_default_Centre_8">[[ o.period_id.name ]] </para></td>
202 <td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>202 <td>
203 <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>203 <para style="terp_default_Centre_8">Date[[ data['form'].get('sort_selection', 'date') == 'date' and ' ' or removeParentNode('para') ]]</para>
204 <para style="terp_default_Centre_8">Reference Number[[ data['form'].get('sort_selection', 'date') == 'ref' and ' ' or removeParentNode('para') ]]</para>
205 </td>
204 </tr>206 </tr>
205 </blockTable>207 </blockTable>
206 <para style="P9">208 <para style="P9">
207209
=== modified file 'account/report/account_journal.sxw'
208Binary 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 differ210Binary 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
=== modified file 'account/report/account_partner_ledger.py'
--- account/report/account_partner_ledger.py 2013-01-23 11:32:53 +0000
+++ account/report/account_partner_ledger.py 2013-06-14 21:43:25 +0000
@@ -267,12 +267,13 @@
267 return result_tmp + result_init267 return result_tmp + result_init
268268
269 def _get_partners(self):269 def _get_partners(self):
270 # TODO: deprecated, to remove in trunk
270 if self.result_selection == 'customer':271 if self.result_selection == 'customer':
271 return 'Receivable Accounts'272 return _('Receivable Accounts')
272 elif self.result_selection == 'supplier':273 elif self.result_selection == 'supplier':
273 return 'Payable Accounts'274 return _('Payable Accounts')
274 elif self.result_selection == 'customer_supplier':275 elif self.result_selection == 'customer_supplier':
275 return 'Receivable and Payable Accounts'276 return _('Receivable and Payable Accounts')
276 return ''277 return ''
277278
278 def _sum_currency_amount_account(self, account, form):279 def _sum_currency_amount_account(self, account, form):
279280
=== modified file 'account/report/account_partner_ledger.rml'
--- account/report/account_partner_ledger.rml 2012-06-13 09:06:00 +0000
+++ account/report/account_partner_ledger.rml 2013-06-14 21:43:25 +0000
@@ -423,7 +423,9 @@
423 </para>423 </para>
424 </td>424 </td>
425 <td>425 <td>
426 <para style="terp_default_Centre_8">[[ get_partners() ]]</para>426 <para style="terp_default_Centre_8">Receivable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer' or removeParentNode('para') ]]</para>
427 <para style="terp_default_Centre_8">Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'supplier' or removeParentNode('para') ]]</para>
428 <para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer_supplier' or removeParentNode('para') ]]</para>
427 </td>429 </td>
428 <td>430 <td>
429 <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>431 <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
430432
=== modified file 'account/report/account_partner_ledger.sxw'
431Binary 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 differ433Binary 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
=== modified file 'account/wizard/account_report_common.py'
--- account/wizard/account_report_common.py 2012-12-19 23:31:33 +0000
+++ account/wizard/account_report_common.py 2013-06-14 21:43:25 +0000
@@ -175,7 +175,7 @@
175 data['form'][field] = data['form'][field][0]175 data['form'][field] = data['form'][field][0]
176 used_context = self._build_contexts(cr, uid, ids, data, context=context)176 used_context = self._build_contexts(cr, uid, ids, data, context=context)
177 data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []177 data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
178 data['form']['used_context'] = used_context178 data['form']['used_context'] = dict(used_context, lang=context.get('lang', 'en_US'))
179 return self._print_report(cr, uid, ids, data, context=context)179 return self._print_report(cr, uid, ids, data, context=context)
180180
181account_common_report()181account_common_report()