Crash when using a Centralised journal with OpenERP 6.1

Bug #1155690 reported by Alexis de Lattre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Undecided
OpenERP Publisher's Warranty Team

Bug Description

Here is the scenario to reproduce the problem on an up-to-date OpenERP 6.1 (up-to-date code from Launchpad/bzr).

1) Install a new DB with demo data
2) Install the account_accountant module
3) Activate extended view for your user
4) In Accounting > Configuration > Financial accounting > Journals > Journals, check that the journal "Opening entries journal" has the option "Centralized Counterpart" = True and that it has a "Default Debit Account" and a "Default Credit Account".

FROM NOW ON, you should use the Gtk Client (maybe you also have the crash with the Web interface, but I have not tested)

5) Go to Accounting > Journal entries > Journal Items, set Journal = "Opening entries journal" and period = "03/2013" and click on "Filter"
6) Enter some lines (enter some text in the "Reference" field) and save them.
7) Select a line that you just created ; then select the content of the field "Reference"
8) Modify the content of the "Reference" field and then press "Enter"
=> You get a traceback :

Environment Information :
System : Linux-3.5.0-26-generic-x86_64-with-Ubuntu-12.10-quantal
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Operating System Release : 3.5.0-26-generic
Operating System Version : #42-Ubuntu SMP Fri Mar 8 23:18:20 UTC 2013
Operating System Architecture : 64bit
Operating System Locale : fr_FR.UTF-8
Python Version : 2.7.3
OpenERP-Client Version : 6.1.1
Last revision No. & ID :2101 launchpad_translations_on_behalf_of_openerp-20121212051256-cl4jswh0kt8ez3tj
Traceback (most recent call last):
  File "/home/alexis/new_boite/dev/server-61/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-61/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/alexis/new_boite/dev/server-61/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/alexis/new_boite/dev/server-61/openerp/osv/osv.py", line 129, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/alexis/new_boite/dev/server-61/openerp/osv/osv.py", line 195, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/alexis/new_boite/dev/server-61/openerp/osv/osv.py", line 183, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/alexis/new_boite/dev/addons-61/account/account_move_line.py", line 1198, in write
    self._check_moves(cr, uid, context=ctx)
  File "/home/alexis/new_boite/dev/addons-61/account/account_move_line.py", line 1118, in _check_moves
    cr.execute('SELECT id, state, name FROM account_move WHERE journal_id = %s AND period_id = %s ORDER BY id limit 1', (context['journal_id'],context['period_id']))
  File "/home/alexis/new_boite/dev/server-61/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/home/alexis/new_boite/dev/server-61/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
DataError: invalid input syntax for integer: "03/2013"
LINE 1: ...account_move WHERE journal_id = 9 AND period_id = '03/2013' ...

When you look at the code of account/account_move_line.py line 1115, you will see that the problem is quite obvious : context['period_id'] contains the name of the period instead of the ID of the period.

The enclosed patch fixes this bug (it's a one-line-patch !).

Tags: maintenance

Related branches

Revision history for this message
Alexis de Lattre (alexis-via) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Nehal Panchal (OpenERP) (nep-openerp) wrote :

Hello,

Thanks for your contribution.

This issue has been fixed in branch: http://bazaar.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-590132-nep/revision/7193
Revision: 7193
Revision ID: <email address hidden>

Thanks

Changed in openobject-addons:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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