[FIX] account coda: if there is not coda statement raise error
bzr revid: ara@tinyerp.com-20101019053159-kl96unqmg03l6trv
This commit is contained in:
parent
91cf831cdd
commit
b7eb35f515
|
@ -45,7 +45,7 @@ class account_coda(osv.osv):
|
|||
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
res = super(account_coda, self).search(cr, user, args=args, offset=offset, limit=limit, order=order,
|
||||
context=context, count=count)
|
||||
if not res:
|
||||
if context.get('bank_statement', False) and not res:
|
||||
raise osv.except_osv('Error', _('Coda file not found for bank statement !!'))
|
||||
return res
|
||||
|
||||
|
|
|
@ -80,12 +80,13 @@
|
|||
id="menu_account_coda_import" sequence="20"/>
|
||||
|
||||
<act_window name="Coda File"
|
||||
domain="[('statement_ids', 'in', [active_id])]"
|
||||
res_model="account.coda"
|
||||
src_model="account.bank.statement"
|
||||
view_type="form"
|
||||
view_mode="tree,form"
|
||||
id="act_account_payment_account_bank_statement"/>
|
||||
domain="[('statement_ids', 'in', [active_id])]"
|
||||
context="{'bank_statement': 1}"
|
||||
res_model="account.coda"
|
||||
src_model="account.bank.statement"
|
||||
view_type="form"
|
||||
view_mode="tree,form"
|
||||
id="act_account_payment_account_bank_statement"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue