[FIX]: fix a journal_id problem for the Accounting/Journal Entry

bzr revid: mga@tinyerp.com-20100908104553-vl5uunhuoz3rfqi9
This commit is contained in:
Mantavya Gajjar 2010-09-08 16:15:53 +05:30
parent eaa8f0be8c
commit 3519efd5a8
1 changed files with 3 additions and 0 deletions

View File

@ -159,6 +159,9 @@ class account_move_line(osv.osv):
return context
def _default_get(self, cr, uid, fields, context={}):
if not context.get('journal_id', False) and not context.get('search_default_journal_id', False):
raise osv.except_osv(_('Warning !'), _('Select the journal to encode entry !'))
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
context['journal_id'] = context.get('search_default_journal_id')