Chirag Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-573257-cpa into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #943359 in OpenERP Server: "Error on view journal items"
  https://bugs.launchpad.net/openobject-server/+bug/943359

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573257-cpa/+merge/100787

Hello,

Fixed unicode string not convert in id.

Ubuntu      :10.04
Web-client  :6.1

Demo: Accounting -> Customer -> Journal Items
1) Click on Open button.

Observed: DataError: invalid input syntax for integer: "X 04/2012"

type(period_id) == str is not allow unicode string, so replace with 
isinstance(period_id, basestring)

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573257-cpa/+merge/100787
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-573257-cpa.
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py	2012-03-06 16:10:40 +0000
+++ account/account_move_line.py	2012-04-04 13:30:29 +0000
@@ -202,13 +202,12 @@
             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]
-                })
+        period_id = context.get('period_id', False)
+        if period_id and isinstance(period_id, basestring):
+            ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
+            context.update({
+                'period_id': ids[0]
+            })
         return context
 
     def _default_get(self, cr, uid, fields, context=None):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to