← Back to team overview

openerp-india team mailing list archive

[Bug 944079] Re: 6.1 Accounting - Journal Entries -> KeyError: 'journal_id'

 

I am having the same error, but in "Journal Items". The crash happens
both with an up-to-date OpenERP 6.1 and an up-to-date OpenERP trunk when
using the Gtk client (I didn't test with the Web client)

Here is the bug scenario :
1. Open "Accounting > Journal Entries > Journal Items"
2. Set a Journal and a Period, then click on "Find"
3. Click on "New". Enter a date, an account, a name, a value for Debit or Credit
4. Press Enter to get a new line -> CRASH

You will find enclosed a screenshot. Here is the backtrace (trunk
version) :

Traceback (most recent call last):
  File "/home/alexis/new_boite/dev/server-trunk/openerp/service/netrpc_server.py", line 64, in run
    result = netsvc.dispatch_rpc(msg[0], msg[1], msg[2:])
  File "/home/alexis/new_boite/dev/server-trunk/openerp/netsvc.py", line 362, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/alexis/new_boite/dev/server-trunk/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/alexis/new_boite/dev/server-trunk/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/alexis/new_boite/dev/server-trunk/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/alexis/new_boite/dev/server-trunk/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/alexis/new_boite/dev/addons-trunk/account/account_move_line.py", line 1246, in create
    self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
KeyError: 'journal_id'

When I look into the code with some prints, here is what I see :

When I enter the "create" function, I have this context : {'lang':
u'en_US', 'tz': False, 'active_model': 'ir.ui.menu', 'department_id':
False, 'period_id': 3, 'active_ids': [171], 'active_id': 171}

Just before I reach self._update_journal_check, here is the value of
context : {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'department_id': False, 'period_id': 3, 'active_ids': [171],
'active_id': 171}

The context doesn't have a "journal_id" key. From my understanding (but
I may be wrong), as I have set a Journal via the seach view, I should
have a key "search_default_journal_id" that is used to create the key
"journal_id" right before the execution of self._update_journal_check.
But I don't have this key "search_default_journal_id" in my context...
and that's the problem I think.

** Attachment added: "Screenshot"
   https://bugs.launchpad.net/openobject-addons/+bug/944079/+attachment/2954907/+files/crash_journal_items.jpg

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/944079

Title:
  6.1 Accounting - Journal Entries -> KeyError: 'journal_id'

Status in OpenERP Addons (modules):
  Incomplete

Bug description:
  Hello,

  I'm not sure if this has already been posted, but I couldn't find a
  matching bug report.

  When trying to create a Journal Entry in Accounting\Journal Entries
  (date, amount ... + hit Enter), a KeyError occurs, although a Journal
  has been selected:

  Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 164, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/conexus/Dokumente/addons/account/account_move_line.py", line 1246, in create
      

  self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
  KeyError: 'journal_id'

  
  2012-03-01 15:08:25,639 5593 ERROR ? openerp.netsvc: journal_id
  > /home/conexus/Dokumente/addons/account/account_move_line.py(1246)create()
  -> self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)


  with kind regards,
  Sven Petersen

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/944079/+subscriptions


References