[IMP]: improve the search view for the account move line

[FIX]: fix a probelm for the loading view for Journal Items

bzr revid: mga@tinyerp.com-20100813122226-n0xklkg5898fxe4v
This commit is contained in:
Mantavya Gajjar 2010-08-13 17:52:26 +05:30
parent 3eb486b62a
commit 23e3cf71de
3 changed files with 17 additions and 8 deletions

View File

@ -910,7 +910,7 @@ class account_move_line(osv.osv):
elif field == 'account_tax_id':
attrs.append('domain="[(\'parent_id\',\'=\',False)]"')
attrs.append("context=\"{'journal_id':journal_id}\"")
elif field == 'account_id' and journal.id:
attrs.append('domain="[(\'journal_id\', \'=\', '+str(journal.id)+'),(\'type\',\'<>\',\'view\'), (\'type\',\'<>\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"')

View File

@ -1059,9 +1059,8 @@
<separator orientation="vertical"/>
<filter icon="terp-stock_symbol-selection" string="Unreconciled" domain="[('reconcile_id','=',False), ('account_id.type','in',['receivable', 'payable'])]" help="Unreconciled Entry Lines"/>
<separator orientation="vertical"/>
<field name="ref" select="1" string="Reference"/>
<field name="move_id" select="1" string="Number (Move)"/>
<field name="name" select="1"/>
<field name="date" select='1'/>
<field name="account_id" select='1'/>
<field name="partner_id" select='1'>
<filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-partner" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
@ -1070,10 +1069,20 @@
<newline/>
<group col="10" colspan="4">
<field name="journal_id" widget="selection" context="{'journal_id':self, 'visible_id':self or 0, 'normal_view':False}"/>
<field name="period_id" context="{'period_id':self, 'search_default_period_id':self}"/>
<separator orientation="vertical"/>
<field name="period_id" context="{'period_id':self, 'search_default_period_id':self}"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="12" col="10">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
<filter string="States" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options...">
<field name="ref" select="1" string="Reference"/>
<field name="name" select="1"/>
<field name="narration" select="1"/>
<field name="date" select='1'/>
<field name="balance" string="Debit/Credit" select='1'/>
</group>
</search>

View File

@ -155,10 +155,10 @@ class account_move_journal(osv.osv_memory):
# 'domain': str([('journal_id', '=', journal_id), ('period_id', '=', period_id)]),
'name': name,
'view_type': 'form',
'view_mode': 'tree,form,graph',
'view_mode': 'tree,graph,form',
'res_model': 'account.move.line',
'view_id': False,
'context': "{'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (journal_id, journal_id, period_id),
'context': "{'visible_id':%s, 'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (journal_id, journal_id, journal_id, period_id),
'type': 'ir.actions.act_window',
'search_view_id': res_id
}