[IMP] account:remove print_data from all journals report ,replace it with get_currency

bzr revid: sbh@tinyerp.com-20100726103508-omibrpykwjw3xnmz
This commit is contained in:
sbh (Open ERP) 2010-07-26 16:05:08 +05:30
parent 123beb6a9d
commit 648e991d73
4 changed files with 14 additions and 37 deletions

View File

@ -50,7 +50,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'get_fiscalyear': self._get_fiscalyear,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'print_data':self._print_data,
'get_currency':self._get_currency,
'get_sortby': self._get_sortby,
})
@ -97,9 +97,9 @@ class journal_print(report_sxw.rml_parse, common_report_header):
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
return super(journal_print ,self)._get_account(data)
def _print_data(self, data):
def _get_currency(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 True
return data['form']['amount_currency']
def _get_sortby(self, data):

View File

@ -249,7 +249,7 @@
<para style="P9">
<font color="white"> </font>
</para>
<blockTable colWidths="40.0,65.0,50.0,62.0,174.0,57.0,61.0,40.0" style="Table1" repeatRows="1">[[ print_data(data) == False or removeParentNode('blockTable') ]]
<blockTable colWidths="40.0,65.0,50.0,62.0,174.0,57.0,61.0,40.0" style="Table1" repeatRows="1">[[ get_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="P10a">Date</para></td>
<td><para style="P10">Voucher No</para></td>
@ -283,7 +283,7 @@
</blockTable>
<blockTable colWidths="50.0,65.0,50.0,60.0,89.0,40.0,60.0,50.0,60.0" style="Table1" repeatRows="1">[[ print_data(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,65.0,50.0,60.0,89.0,40.0,60.0,50.0,60.0" style="Table1" repeatRows="1">[[ get_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="P10a">Date</para></td>
<td><para style="P10">Voucher No</para></td>

View File

@ -48,7 +48,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'get_sortby': self._get_sortby,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'print_data':self._print_data,
'get_currency':self._get_currency,
})
def set_context(self, objects, data, ids, report_type=None): # Improve move to common default?
@ -89,9 +89,9 @@ 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):
def _get_currency(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 True
return data['form']['amount_currency']
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header='internal')

View File

@ -4,30 +4,7 @@
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="42.0" width="539" height="758"/>
<pageGraphics>
<!--logo-->
<!--<fill color="darkblue"/>-->
<!--<stroke color="darkblue"/>-->
<!--TITLE COMPANY-->
<!-- <drawString x="4.6cm" y="28.7cm">[[ company.partner_id.name ]]</drawString> -->
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawString x="16.7cm" y="28.1cm">Central Journal - [[ company.currency_id.name ]]</drawString>
<!--COL 2-->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>0.88cm 27.7cm 20.12cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</pageTemplate>
</template>
@ -306,7 +283,7 @@
<para style="P9">
<font color="white"> </font>
</para>
<blockTable colWidths="50.0,200.0,95.0,92.0,69.0" style="Table_Account_detail_Title">[[ print_data(data) == False or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,200.0,95.0,92.0,69.0" style="Table_Account_detail_Title">[[ get_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_Details">A/C No.</para></td>
<td><para style="terp_tblheader_Details">Account Name</para></td>
@ -315,7 +292,7 @@
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,150.0,95.0,92.0,69.0,80.0" style="Table_Account_detail_Title_Currency">[[ print_data(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,150.0,95.0,92.0,69.0,80.0" style="Table_Account_detail_Title_Currency">[[ get_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_Details">A/C No.</para></td>
<td><para style="terp_tblheader_Details">Account Name</para></td>
@ -328,7 +305,7 @@
<para style="terp_default_2">
<font color="white"> </font>
</para>
<blockTable colWidths="50.0,200.0,94.0,92.0,69.0" style="Table_Final_Total">[[ print_data(data) == False or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,200.0,94.0,92.0,69.0" style="Table_Final_Total">[[ get_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_Bold_9">Total:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
@ -337,7 +314,7 @@
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_credit(o.period_id.id, o.journal_id.id) ) ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,150.0,95.0,92.0,69.0,80.0" style="Table_Final_Total_currency">[[ print_data(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,150.0,95.0,92.0,69.0,80.0" style="Table_Final_Total_currency">[[ get_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_Bold_9">Total:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
@ -352,7 +329,7 @@
</para>
<section>
<para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]]</para>
<blockTable colWidths="50.0,200.0,94.0,92.0,69.0" style="Table_Journal_Line_Content">[[ print_data(data) == False or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,200.0,94.0,92.0,69.0" style="Table_Journal_Line_Content">[[ get_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
@ -361,7 +338,7 @@
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']-line['credit']) ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,150.0,95.0,92.0,69.0,80.0" style="Table_Journal_Line_Content_currency">[[ print_data(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,150.0,95.0,92.0,69.0,80.0" style="Table_Journal_Line_Content_currency">[[ get_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>