Error on view journal items

Bug #943359 reported by Erwin van der Ploeg (BAS Solutions)
64
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP Publisher's Warranty Team

Bug Description

error when viewing journal items in 6.1

Client Traceback (most recent call last):
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\common\http.py", line 180, in dispatch
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\controllers\main.py", line 1163, in load
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\controllers\main.py", line 1045, in fields_view_get
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\common\openerplib\main.py", line 250, in proxy
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\common\http.py", line 611, in send

Server Traceback (most recent call last):
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\web\common\http.py", line 592, in send
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\netsvc.py", line 360, in dispatch_rpc
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\service\web_services.py", line 572, in dispatch
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\osv.py", line 167, in execute_kw
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\osv.py", line 121, in wrapper
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\osv.py", line 176, in execute
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\osv.py", line 164, in execute_cr
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\account\account_move_line.py", line 967, in fields_view_get
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\orm.py", line 2149, in fields_view_get
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\orm.py", line 1789, in __view_look_dom_arch
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\osv\orm.py", line 1695, in __view_look_dom
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\openerp\addons\account\account_move_line.py", line 930, in view_header_get
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\sql_db.py", line 152, in wrapper
  File "C:\Program Files\OpenERP 6.1-20120229-003254\server\.\openerp\sql_db.py", line 212, in execute
DataError: invalid input syntax for integer: "02/2012"

Related branches

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Erwin ,

I have checked this issue with 6.1 as well as trunk.but
I did not get any Trace back like yours. So would you please
provide more information regarding this issue.

Thanks and waiting for reply!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

In attachment a pdf with the steps to explain the error.

Erwin

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Erwin ,

I have checked this with updated 6.1 and trunk , But I did not
face any problem like your.So would you please check this
with latest 6.1.

I have attached a video for more reference.

Thank you!

Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

I do exactly the same thing, but the error stays.

The latest message is: DataError: invalid input syntax for integer: "03/2012"

What can I do more to make it clear?

Erwin

Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

Also made a vedeo in the attachment. Hope this makes it clearer.

Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

I have the same problem on two different PC's with two diferemt databases. Help is welcome!

Erwin

Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

What can I do to make the problem moren clear?

Revision history for this message
Thanh Vu (vuvanthanh) wrote :

I have exactly the same problem when using webclient & OpenERP server 6.1 (stable release).
Note that this error happen when you try to view Journals from the following sections in Accounting module: "Customers", "Suppliers", "Bank and Cash".
BTW, If I use GTK client, there is NO such an error.

Regards,
Thanh
=======
Client Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 180, in dispatch
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1161, in load
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1043, in fields_view_get
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 250, in proxy
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 611, in send

Server Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 592, in send
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\netsvc.py", line 360, in dispatch_rpc
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\service\web_services.py", line 572, in dispatch
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\osv.py", line 167, in execute_kw
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\osv.py", line 121, in wrapper
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\osv.py", line 176, in execute
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\osv.py", line 164, in execute_cr
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\account\account_move_line.py", line 967, in fields_view_get
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\orm.py", line 2149, in fields_view_get
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\orm.py", line 1789, in __view_look_dom_arch
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\osv\orm.py", line 1695, in __view_look_dom
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\account\account_move_line.py", line 930, in view_header_get
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\sql_db.py", line 152, in wrapper
  File "C:\Program Files (x86)\OpenERP 6.1-1\server\.\openerp\sql_db.py", line 212, in execute
DataError: invalid input syntax for integer: "03/2012"

Revision history for this message
Thanh Vu (vuvanthanh) wrote :

BTW, here is my settings:
- OS: Windows 7
- Database: Postgres 8.3
- Browsers: IE & Firefox both see the problem

Revision history for this message
Thanh Vu (vuvanthanh) wrote :

This bug still exist in 6.2 trunk
It should be a critical bug since we can't view/create journals in Customers, Suppliers, and "Bank & Cash" sections!

Regards,
Thanh

Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

Anyone for help?

Erwin

Revision history for this message
Erwin van der Ploeg (BAS Solutions) (erwin-bassolutions-deactivatedaccount) wrote :

What can i do to help. Problem still exists in nighly build of 19-03.

Erwin

Revision history for this message
Eric (0cs935k-eric-wz6bkyh) wrote :

Same problem here. Server is running Win 2k3, Postgre 9.1, and OpenERP 6.1 Stable.

Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Eric (0cs935k-eric-wz6bkyh) wrote :

It looks like in view_header_get in account_move_line.py, context['period_id'] is returning a date (string) and not an id (integer) like it should be.

It's a band aid fix, but changing

cr.execute('SELECT code FROM account_period WHERE id = %s', (context['period_id'], ))

to

cr.execute('SELECT code FROM account_period WHERE code = %s', (context['period_id'], ))

seems to make it behave as intended for now.

Changed in openobject-server:
status: Confirmed → In Progress
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Erwin,

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

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

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

Thanks

Changed in openobject-server:
status: In Progress → Fix Committed
affects: openobject-server → openobject-addons
Revision history for this message
jasimmk (jasimmk-c) wrote :

You will have to change the function to detect the period id in unicode also,

Patch the addons/account/account_move_line.py function

    def convert_to_period(self, cr, uid, context=None):
        if context is None:
            context = {}
        period_obj = self.pool.get('account.period')
        #check if the period_id changed in the context from client side
        if context.get('period_id', False):
            period_id = context.get('period_id')
            if type(period_id) == str:
                ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
                context.update({
                    'period_id': ids[0]
                })
        return context

to support unicode period ids

  def convert_to_period(self, cr, uid, context=None):
        if context is None:
            context = {}
        period_obj = self.pool.get('account.period')
        #check if the period_id changed in the context from client side
        if context.get('period_id', False):
            period_id = context.get('period_id')
            if type(period_id) == str or type(period_id) == unicode:
                ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
                context.update({
                    'period_id': ids[0]
                })
        return context

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

It seems that the fix has landed in addons/6.1 with this commit on 2012-09-06

revno: 6979 [merge]
committer: Olivier Dony <email address hidden>
branch nick: 6.1
timestamp: Thu 2012-09-06 16:35:17 +0200
message:
  [MERGE] OPW 573257: account.move.line: proper handling of unicode values in period name resolution

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.