[Fix] account: Fix the probelm of print the report in object
bzr revid: sbh@tinyerp.com-20100720065732-2wnx7dlw7rgr5f20
This commit is contained in:
@@ -52,7 +52,8 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
||||
'get_filter': self._get_filter,
|
||||
'get_journal': self._get_journal,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'print_data':self._print_data,
|
||||
})
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None): # Improve move to common default?
|
||||
@@ -125,6 +126,10 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
|
||||
return super(journal_print ,self)._get_fiscalyear(data)
|
||||
|
||||
def _print_data(self, data):
|
||||
if data['model']=='account.journal.period':
|
||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).journal_id.currency or False
|
||||
return data['form']['amount_currency']
|
||||
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -287,7 +287,7 @@
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="62.0,118.0,89.0,83.0,77.0,100.0" style="Table_Journal_Title" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="62.0,118.0,89.0,83.0,77.0,100.0" style="Table_Journal_Title" repeatRows="1"><para>[[ print_data(data)==False or removeParentNode('blockTable') ]]</para>
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">Code</para></td>
|
||||
<td><para style="terp_tblheader_Details">Journal Name</para></td>
|
||||
@@ -305,7 +305,7 @@
|
||||
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit()- sum_credit()) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="60.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Title" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="60.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Title" repeatRows="1">[[ print_data(data)== True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">Code</para></td>
|
||||
<td><para style="terp_tblheader_Details">Journal Name</para></td>
|
||||
@@ -327,7 +327,7 @@
|
||||
</blockTable>
|
||||
|
||||
<section>
|
||||
<blockTable colWidths="61.0,119.0,91.0,83.0,76.0,100.0" style="Table_Journal_Detail">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="61.0,119.0,91.0,83.0,76.0,100.0" style="Table_Journal_Detail">[[ print_data(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(lines(o.id),'line')]]</font> [[ line['code'] ]]</para>
|
||||
@@ -349,7 +349,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="70.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Detail">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="70.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Detail">[[print_data(data)== True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9"><font>[[ repeatIn(lines(o.id),'line')]]</font> [[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
|
||||
Reference in New Issue
Block a user