← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/6.0-opw-5583-ach into lp:openobject-addons/6.0

 

Anup(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/6.0-opw-5583-ach into lp:openobject-addons/6.0.

Requested reviews:
  Jay Vora (OpenERP) (jvo-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-5583-ach/+merge/60171

Hello,

  There is a problem with the Profit Report. Just Change the language, Say French and you'll see that the string 'Net Profit' is not being displayed in the report.

  I have found a solution for the same.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-5583-ach/+merge/60171
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/6.0-opw-5583-ach.
=== modified file 'account/report/account_profit_horizontal.rml'
--- account/report/account_profit_horizontal.rml	2011-01-14 00:11:01 +0000
+++ account/report/account_profit_horizontal.rml	2011-05-06 11:55:48 +0000
@@ -244,19 +244,19 @@
           <para style="terp_default_Bold_9"></para>
         </td>
         <td>
-          <para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or '' ]]</para>
+          <para style="terp_default_Bold_9">[[ final_result()['type'] == get_trans('Net Profit') and final_result()['type'] or '' ]]</para>
         </td>
         <td>
-          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and  formatLang(abs(final_result()['balance'])) ]] [[ company.currency_id.symbol ]]</para>
+          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == get_trans('Net Profit') and  formatLang(abs(final_result()['balance'])) ]] [[ company.currency_id.symbol ]]</para>
         </td>
         <td>
           <para style="terp_default_Bold_9"></para>
         </td>
         <td>
-          <para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss' and final_result()['type'] or '' ]]</para>
+          <para style="terp_default_Bold_9">[[ final_result()['type'] == get_trans('Net Loss') and final_result()['type'] or '' ]]</para>
         </td>
         <td>
-          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and  formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]</para>
+          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == get_trans('Net Loss') and  formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == get_trans('Net Loss') and company.currency_id.symbol ]]</para>
         </td>
       </tr>
     </blockTable>

=== modified file 'account/report/account_profit_loss.py'
--- account/report/account_profit_loss.py	2011-04-05 08:52:20 +0000
+++ account/report/account_profit_loss.py	2011-05-06 11:55:48 +0000
@@ -53,6 +53,7 @@
             'get_end_date':self._get_end_date,
             'get_company':self._get_company,
             'get_target_move': self._get_target_move,
+            'get_trans':self._get_trans
         })
         self.context = context
 
@@ -77,6 +78,9 @@
             self.result_sum_cr += self.res_pl['balance']
         return self.result_sum_cr
 
+    def _get_trans(self, source):
+        return _(source)
+    
     def get_data(self, data):
         cr, uid = self.cr, self.uid
         db_pool = pooler.get_pool(self.cr.dbname)

=== modified file 'account/report/account_profit_loss.rml'
--- account/report/account_profit_loss.rml	2011-01-14 00:11:01 +0000
+++ account/report/account_profit_loss.rml	2011-05-06 11:55:48 +0000
@@ -228,10 +228,10 @@
           <para style="terp_default_Bold_9"></para>
         </td>
         <td>
-          <para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
+          <para style="terp_default_Bold_9">[[ final_result()['type'] == get_trans('Net Profit') and final_result()['type'] or removeParentNode('blockTable') ]]</para>
         </td>
         <td>
-          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and  formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and company.currency_id.symbol ]]</para>
+          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == get_trans('Net Profit') and  formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == get_trans('Net Profit') and company.currency_id.symbol ]]</para>
         </td>
       </tr>
     </blockTable>
@@ -283,10 +283,10 @@
           <para style="terp_default_Bold_9"></para>
         </td>
         <td>
-          <para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
+          <para style="terp_default_Bold_9">[[ final_result()['type'] == get_trans('Net Loss') and final_result()['type'] or removeParentNode('blockTable') ]]</para>
         </td>
         <td>
-          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and  formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]</para>
+          <para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == get_trans('Net Loss') and  formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == get_trans('Net Loss') and company.currency_id.symbol ]]</para>
         </td>
       </tr>
     </blockTable>


Follow ups