[FIX] delivery.carrier: write() failed to handle ids=int case
authorOlivier Dony <odo@openerp.com>
Fri, 10 Feb 2012 15:16:49 +0000 (16:16 +0100)
committerOlivier Dony <odo@openerp.com>
Fri, 10 Feb 2012 15:16:49 +0000 (16:16 +0100)
lp bug: https://launchpad.net/bugs/930127 fixed

bzr revid: odo@openerp.com-20120210151649-xfwkf7xk1zv3s3nx

addons/delivery/delivery.py

index 10db8e8..1b31672 100644 (file)
@@ -149,9 +149,11 @@ class delivery_carrier(osv.osv):
         return True
 
     def write(self, cr, uid, ids, vals, context=None):
-        res_id = super(delivery_carrier, self).write(cr, uid, ids, vals, context=context)
+        if isinstance(ids, (int,long)):
+            ids = [ids]
+        res = super(delivery_carrier, self).write(cr, uid, ids, vals, context=context)
         self.create_grid_lines(cr, uid, ids, vals, context=context)
-        return res_id
+        return res
 
     def create(self, cr, uid, vals, context=None):
         res_id = super(delivery_carrier, self).create(cr, uid, vals, context=context)