[FIX] account_move_line: update journal_id in create
lp bug: https://launchpad.net/bugs/834512 fixed bzr revid: jap@tinyerp.com-20111215055306-f0y5x1f4w91yvpxe
This commit is contained in:
parent
3ad3baefba
commit
c5ebf9bdbf
|
@ -1249,6 +1249,8 @@ class account_move_line(osv.osv):
|
||||||
if len(period_candidate_ids) != 1:
|
if len(period_candidate_ids) != 1:
|
||||||
raise osv.except_osv(_('Encoding error'), _('No period found or period given is ambigous.'))
|
raise osv.except_osv(_('Encoding error'), _('No period found or period given is ambigous.'))
|
||||||
context['period_id'] = period_candidate_ids[0][0]
|
context['period_id'] = period_candidate_ids[0][0]
|
||||||
|
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
|
||||||
|
context['journal_id'] = context.get('search_default_journal_id')
|
||||||
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
|
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
|
||||||
move_id = vals.get('move_id', False)
|
move_id = vals.get('move_id', False)
|
||||||
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
|
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
|
||||||
|
|
Loading…
Reference in New Issue