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

Bug #944079 reported by conexus.at
34
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team

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

Tags: maintenance

Related branches

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello conexus,

I have checked your issue in both GTK and WEB . it's working properly at my end .
For your reference , I have attached screen shot .Please go throw it.

If you still faced the problem . undoubtedly report back to us

Thanks!!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

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.

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openobject-addons:
status: Incomplete → Confirmed
status: Confirmed → In Progress
Changed in openobject-addons:
importance: Undecided → Low
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello conexus,

It has been fixed into the lp:~openerp-dev/openobject-addons/6.1-opw-573299-skh branch with,

Revision ID: <email address hidden>
Revision Number: 6717

This branch is under the review of our experts and will be merged soon into the stable 6.1.

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

We really need to have it merged in the stable 6.1 branch ! This bug prevents users from entering accounting entries by hand... it's not a small bug ! If we want OpenERP to have some credibility on accounting, we can't leave it like that for so long !

Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello conexus,

As per discussion with our experts we have found that the issue should be fixed from GTK due to context related issue, Context are not getting updated when creating new record into the editable mode

It has been fixed into the lp:~openerp-dev/openobject-client/6.1-opw-573299-skh branch with,

Revision ID: <email address hidden>
Revision Number: 2059

This branch is under the review of our experts and will be merged soon into the stable 6.1.

Thanks

Revision history for this message
gde (OpenERP) (gde-openerp) wrote :

the problem is also reproductible with the web client. Should be fixed there also.

Revision history for this message
Houssine (houssine-bakkali) wrote :

Hi guys,

Any news about this issue? We've experienced it through the web client and not the gtk so the problem should be located from the server side or from both clients(web and gtk).

As project are analytic accounts it also happens when we tried to update an timesheet entry

see this link for explaination : https://bugs.launchpad.net/openobject-addons/+bug/985692

As Alexis said this is a major issue from an analytic accounting(and project management) point of view!

Thanks,
Houssine

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

Note that the issue has been fixed in the official branch lp:openobject-client/6.1 on 2012-05-09 with revno 2059 (1 line patch)

Revision history for this message
Houssine (houssine-bakkali) wrote :

Thanks Alexis,

Although,I found that this bug has also been reported for my case

https://bugs.launchpad.net/openobject-addons/+bug/953006

and has been fixed.

Revision history for this message
conexus - s.petersen (s.petersen) wrote :

Hello,

i get no error message in the Web Client, but it doesn't work, no counterpart entry is created.
Perhaps the following Bug is also connected to this Problem:

https://bugs.launchpad.net/openobject-addons/+bug/834512

with kind regards,
Sven

Changed in openobject-addons:
status: Fix Committed → Fix Released
milestone: none → 6.2
Revision history for this message
Julián Lozano (jlozano) wrote :

Good evening

I am using the web interface of the OpenERP 7. When I want to add journal entries to a opening journal appears the following

OpenERP Server Error
Client Traceback (most recent call last):
  File "/opt/openerp-scalaria/server/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/openerp-scalaria/server/openerp/addons/web/controllers/main.py", line 1078, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/opt/openerp-scalaria/server/openerp/addons/web/controllers/main.py", line 1070, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/openerp-scalaria/server/openerp/addons/web/session.py", line 43, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/openerp-scalaria/server/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/openerp-scalaria/server/openerp/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/openerp-scalaria/server/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp-scalaria/server/openerp/netsvc.py", line 289, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp-scalaria/server/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp-scalaria/server/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp-scalaria/server/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp-scalaria/server/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp-scalaria/server/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp-scalaria/server/openerp/addons/base_import/models.py", line 320, in do
    cr, uid, import_fields, data, context=context)
  File "/opt/openerp-scalaria/server/openerp/osv/orm.py", line 1362, in load
    noupdate=noupdate, res_id=id, context=context))
  File "/opt/openerp-scalaria/server/openerp/addons/base/ir/ir_model.py", line 956, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/opt/openerp-scalaria/server/openerp/addons/account/account_move_line.py", line 1163, in create
    self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
KeyError: 'journal_id'

I am sorry If I ask for simple things, but I recenlty begin to work with OpenERP

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.