← Back to team overview

clearcorp team mailing list archive

lp:~dr.clearcorp/openerp-ccorp-addons/6.1-fix_bug_journal_report into lp:openerp-ccorp-addons/6.1

 

Diana Rodríguez Martínez has proposed merging lp:~dr.clearcorp/openerp-ccorp-addons/6.1-fix_bug_journal_report into lp:openerp-ccorp-addons/6.1.

Requested reviews:
  CLEARCORP drivers (clearcorp-drivers)

For more details, see:
https://code.launchpad.net/~dr.clearcorp/openerp-ccorp-addons/6.1-fix_bug_journal_report/+merge/154223

[FIX] Fix the account_journal_period_report.mako. Add method that print the move name and fix the bug with read permissions.
-- 
https://code.launchpad.net/~dr.clearcorp/openerp-ccorp-addons/6.1-fix_bug_journal_report/+merge/154223
Your team CLEARCORP development team is subscribed to branch lp:openerp-ccorp-addons/6.1.
=== added directory 'account_journal_period_report/i18n'
=== added file 'account_journal_period_report/i18n/es_CR.po'
--- account_journal_period_report/i18n/es_CR.po	1970-01-01 00:00:00 +0000
+++ account_journal_period_report/i18n/es_CR.po	2013-03-19 22:34:23 +0000
@@ -0,0 +1,110 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_journal_period_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-03-19 21:51+0000\n"
+"PO-Revision-Date: 2013-03-19 21:51+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:63
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:71
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:105
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:115
+msgid "TOTAL"
+msgstr "TOTAL"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:31
+msgid "Chart of Accounts: "
+msgstr "Plan contable: "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:33
+msgid "Selected period: "
+msgstr "Período seleccionado: "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:34
+msgid "Entries Sorted By:"
+msgstr "Entradas ordenadas por:"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:61
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:69
+msgid "Move"
+msgstr "Asiento"
+
+#. module: account_journal_period_report
+#: constraint:account.print.journal:0
+msgid "The fiscalyear, periods or chart of account chosen have to belong to the same company."
+msgstr "El año fiscal, periodos y árbol de cuentas escogido deben pertenecer a la misma compañía."
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:62
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:70
+msgid "Date"
+msgstr "Fecha"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:67
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:75
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:76
+msgid "Amount Currency"
+msgstr "Divisa"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:24
+msgid "Journal Report "
+msgstr "Reporte de Diarios "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:35
+msgid "Target Moves: "
+msgstr "Movimientos destino: "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:66
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:74
+msgid "Debit"
+msgstr "Débito"
+
+#. module: account_journal_period_report
+#: model:ir.model,name:account_journal_period_report.model_account_print_journal
+msgid "Account Print Journal"
+msgstr "Contabilidad. Imprimir diario"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:64
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:72
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:65
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:73
+msgid "Label"
+msgstr "Nombre"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:32
+msgid "Fiscal Year: "
+msgstr "Año fiscal: "
+

=== modified file 'account_journal_period_report/report/account_journal_period_report.mako'
--- account_journal_period_report/report/account_journal_period_report.mako	2013-01-17 19:12:32 +0000
+++ account_journal_period_report/report/account_journal_period_report.mako	2013-03-19 22:34:23 +0000
@@ -52,6 +52,7 @@
            </div>
            <% 
               journal_move_lines = lines(period_id, journal.id)  
+              move_names = extract_name_move(cr, uid, journal_move_lines)
            %>
            <div class="table list">
                 <div class="table-header">
@@ -76,14 +77,10 @@
                        %endif
                     </div>
                 </div>
-                <div class="table-body">                    
+                <div class="table-body"> 
                     %for line in journal_move_lines:
                         <div class="table-row ${row_even and 'even' or 'odd'}">
-                            %if line.move_id.name:
-                                <div class="table-cell first-column">${line.move_id.name} </div>
-                            %else:
-                                <div class="table-cell first-column">${line.move_id.id} </div>
-                            %endif
+                            <div class="table-cell first-column">${move_names[line.id]} </div>
                             <div class="table-cell">${formatLang(line.date,date=True)}</div>
                             <div class="table-cell">${line.account_id.code}</div>
                             <div class="table-cell">${line.partner_id.name or ''}</div>

=== modified file 'account_journal_period_report/report/account_journal_period_report.py'
--- account_journal_period_report/report/account_journal_period_report.py	2013-01-17 19:12:32 +0000
+++ account_journal_period_report/report/account_journal_period_report.py	2013-03-19 22:34:23 +0000
@@ -25,6 +25,8 @@
 from report import report_sxw
 import locale
 from account.report.account_journal import journal_print
+from wadllib.application import Parameter
+from symbol import parameters
 
 #la herencia se debe hacer de journal_print (clase original del reporte)
 #para que se llame el init y el set context, y se puedan usar las variables y métodos.
@@ -39,13 +41,34 @@
 
         self.localcontext.update({
             'get_journal_list': self.get_journal_list,  
-            'get_format_lang_currency': self.pool.get('account.webkit.report.library').format_lang_currency,      
+            'get_format_lang_currency': self.pool.get('account.webkit.report.library').format_lang_currency,  
+            'extract_name_move':self.extract_name_move,  
+            'cr': cr,  
+            'uid': uid,
         })
             
     #Receive the journal_ids and return the full object
     def get_journal_list(self, journal_ids):
         return self.pool.get('account.journal').browse(self.cr, self.uid, journal_ids)     
-
+    
+    ''''
+    This method is created to solve the error when extracting the name move_id (line.move_id.name) fails because of read permissions
+    parameter move_lines are the move_lines that match with the journal and period. Pass from mako. 
+    ''' 
+    def extract_name_move(self, cr, uid, move_lines):
+        move_temp = self.pool.get('account.move')
+        dict_name = {} #dict_name keys is the line id. 
+        
+        for line in move_lines:
+            move_id = move_temp.search(cr, uid, [('id', '=', line.move_id.id)])
+            move_obj = move_temp.browse(cr, uid, move_id)
+            if move_obj[0].name:
+                dict_name[line.id] = move_obj[0].name
+            else:
+                 dict_name[line.id] = move_obj[0].id
+        
+        return dict_name
+            
 #the parameters are the report name and module name 
 report_sxw.report_sxw( 'report.account_journal_period_print_inherit', 
                        'account.print.journal',


Follow ups