[FIX]: fix a problme for the reports print

[FIX]: fix a probject of context for the journal_id

bzr revid: mga@tinyerp.com-20100911055147-juvw3gof691oqt4z
This commit is contained in:
Mantavya Gajjar 2010-09-11 11:21:47 +05:30
parent f91a77c7a8
commit bbe535e43e
5 changed files with 9 additions and 5 deletions

View File

@ -369,6 +369,7 @@ class account_account(osv.osv):
('other', 'Regular'), ('other', 'Regular'),
('receivable', 'Receivable'), ('receivable', 'Receivable'),
('payable', 'Payable'), ('payable', 'Payable'),
('liquidity','Liquidity'),
('consolidation', 'Consolidation'), ('consolidation', 'Consolidation'),
('closed', 'Closed'), ('closed', 'Closed'),
], 'Internal Type', required=True, help="This type is used to differentiate types with "\ ], 'Internal Type', required=True, help="This type is used to differentiate types with "\

View File

@ -174,10 +174,10 @@
<blockTable colWidths="52.0,123.0,50.0,92.0,83.0,124.0" style="Table4"> <blockTable colWidths="52.0,123.0,50.0,92.0,83.0,124.0" style="Table4">
<tr> <tr>
<td> <td>
<para style="terp_default_Bold_9">Type:</para> <para style="terp_default_Bold_9">Journal:</para>
</td> </td>
<td> <td>
<para style="terp_default_9">[[ voucher.type ]]</para> <para style="terp_default_9">[[ voucher.journal_id.name ]]</para>
</td> </td>
<td> <td>
<para style="terp_default_Bold_9">Number:</para> <para style="terp_default_Bold_9">Number:</para>

View File

@ -160,7 +160,7 @@
<para style="terp_default_Bold_9">Type:</para> <para style="terp_default_Bold_9">Type:</para>
</td> </td>
<td> <td>
<para style="terp_default_9">[[ voucher.type ]]</para> <para style="terp_default_9">[[ voucher.journal_id.nme ]]</para>
</td> </td>
<td> <td>
<para style="terp_default_Bold_9">Number:</para> <para style="terp_default_Bold_9">Number:</para>

View File

@ -57,6 +57,9 @@ class account_voucher(osv.osv):
journal_pool = self.pool.get('account.journal') journal_pool = self.pool.get('account.journal')
if context.get('journal_id', False): if context.get('journal_id', False):
return context.get('journal_id') return context.get('journal_id')
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
return context.get('search_default_journal_id')
ttype = context.get('type', 'bank') ttype = context.get('type', 'bank')
res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1) res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
return res and res[0] or False return res and res[0] or False

View File

@ -139,8 +139,8 @@
</group> </group>
<newline/> <newline/>
<group col='8' colspan='4'> <group col='8' colspan='4'>
<field name="journal_id" widget="selection" select="1"/> <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" />
<field name="period_id" select="1"/> <field name="period_id" groups="base.group_extended"/>
</group> </group>
<newline/> <newline/>
<group expand="0" string="Group By..." colspan="12" col="10"> <group expand="0" string="Group By..." colspan="12" col="10">