From a31e898d4423ceb3de45e70dafdb0e3b72dedbb1 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Tue, 13 Oct 2009 19:39:37 +0530 Subject: [PATCH] [IMP]read method: to change for putting warning message on save event bzr revid: hmo@tinyerp.com-20091013140937-5wb96hu59xn152r0 --- bin/osv/orm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index e64ff8bdfdd..52373b61f9c 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1476,7 +1476,7 @@ class orm_memory(orm_template): self.unlink(cr, uid, ids) return True - def read(self, cr, user, ids, fields_to_read=None, context=None, load='_classic_read'): + def read(self, cr, user, ids, fields_to_read=None, context=None, load='_classic_read'): if not context: context = {} if not fields_to_read: @@ -2213,12 +2213,13 @@ class orm(orm_template): select = ids if isinstance(ids, (int, long)): select = [ids] + select = map(lambda x: isinstance(x,dict) and x['id'] or x, select) result = self._read_flat(cr, user, select, fields, context, load) for r in result: for key, v in r.items(): if v == None: r[key] = False - if isinstance(ids, (int, long)): + if isinstance(ids, (int, long, dict)): return result and result[0] or False return result