summaryrefslogtreecommitdiff
path: root/addons/document_webdav/nodes.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-12-17 03:13:23 +0100
committerAntony Lesuisse <al@openerp.com>2012-12-17 03:13:23 +0100
commitd01868ed74127061c04ffca0f79f72f5e7beb250 (patch)
tree3c7963a6e2091a4df4599d9b4da5f26be21dc2b8 /addons/document_webdav/nodes.py
parent25acb93277f1f38fa7d8db4493e42bc48bfde861 (diff)
webdav fixes
bzr revid: al@openerp.com-20121217021323-0u771l13oo3hqu7m
Diffstat (limited to 'addons/document_webdav/nodes.py')
-rw-r--r--addons/document_webdav/nodes.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/addons/document_webdav/nodes.py b/addons/document_webdav/nodes.py
index babe10a519e..aab83766514 100644
--- a/addons/document_webdav/nodes.py
+++ b/addons/document_webdav/nodes.py
@@ -27,10 +27,18 @@ import urllib
import uuid
from openerp import SUPERUSER_ID
-try:
- from tools.dict_tools import dict_filter
-except ImportError:
- from document.dict_tools import dict_filter
+def dict_filter(srcdic, keys, res=None):
+ ''' Return a copy of srcdic that has only keys set.
+ If any of keys are missing from srcdic, the result won't have them,
+ either.
+ @param res If given, result will be updated there, instead of a new dict.
+ '''
+ if res is None:
+ res = {}
+ for k in keys:
+ if k in srcdic:
+ res[k] = srcdic[k]
+ return res
class node_acl_mixin(object):
def _get_dav_owner(self, cr):