From 63159fee7b19d8eed7b03f008349413276d75c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20V=C3=A1squez?= Date: Fri, 13 Sep 2013 11:39:12 -0600 Subject: [PATCH] [FIX] document: check method fails if it is called with an id instead of a list of ids lp bug: https://launchpad.net/bugs/1225107 fixed bzr revid: carlos.vasquez@clearcorp.co.cr-20130913173912-h4oec41fwh9pg69f --- addons/document/document.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/document/document.py b/addons/document/document.py index a39be42e77c..0b49d581a3c 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -71,6 +71,10 @@ class document_file(osv.osv): def check(self, cr, uid, ids, mode, context=None, values=None): """Overwrite check to verify access on directory to validate specifications of doc/access_permissions.rst""" super(document_file, self).check(cr, uid, ids, mode, context=context, values=values) + + # write method can be called with either the ids list or an id, if the later is used, the ids received here will be a long variable. + if not isinstance(ids, list): + ids = [ids] if ids: self.pool.get('ir.model.access').check(cr, uid, 'document.directory', mode)