diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index 70671507b01..5272d0fc1fd 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -494,6 +494,17 @@ class res_node_calendar(nodes.node_class): res = '%d' % (self.calendar_id) return res + def _get_wtag(self, cr): + uid = self.context.uid + context = self.context.context + if self.model and self.res_id: + mod_obj = self.context._dirobj.pool.get(self.model) + pr = mod_obj.perm_read(cr, uid, [self.res_id], context=context, details=False)[0] + self.write_date = pr.get('write_date') or pr.get('create_date') + + # Super will use self.write_date, so we should be fine. + return super(res_node_calendar, self)._get_wtag(cr) + def rm(self, cr): uid = self.context.uid res = False diff --git a/addons/document/directory_report.py b/addons/document/directory_report.py index 6eb18dae850..1665a7abf68 100644 --- a/addons/document/directory_report.py +++ b/addons/document/directory_report.py @@ -42,8 +42,12 @@ class ir_action_report_xml(osv.osv): def _model_search(self, cr, uid, obj, name, args, context=None): if not len(args): return [] + assert len(args) == 1 and args[0][1] == '=', 'expression is not what we expect: %r' % args model_id= args[0][2] if not model_id: + # a deviation from standard behavior: when searching model_id = False + # we return *all* reports, not just ones with empty model. + # One reason is that 'model' is a required field so far return [] model = self.pool.get('ir.model').read(cr, uid, [model_id])[0]['model'] report_id = self.search(cr, uid, [('model','=',model)]) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 1b7aebcd389..0c4194847c1 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -23,6 +23,7 @@ import pooler from tools.safe_eval import safe_eval +from tools.misc import ustr import errno # import os import time @@ -808,7 +809,7 @@ class node_res_dir(node_class): return res[0] return None - def _child_get(self, cr, name = None, domain=None): + def _child_get(self, cr, name=None, domain=None): """ return virtual children of resource, based on the foreign object. @@ -868,7 +869,7 @@ class node_res_dir(node_class): # Escape the name for characters not supported in filenames res_name = res_name.replace('/','_') # any other weird char? - if name and (res_name != name): + if name and (res_name != ustr(name)): # we have matched _ to any character, but we only meant to match # the special ones. # Eg. 'a_c' will find 'abc', 'a/c', 'a_c', may only @@ -1044,7 +1045,7 @@ class node_res_obj(node_class): if not res_name: continue res_name = res_name.replace('/', '_') - if name and (res_name != name): + if name and (res_name != ustr(name)): continue # TODO Revise klass = directory.get_node_class(directory, dynamic=True, context=ctx) diff --git a/addons/document_ics/document_view.xml b/addons/document_ics/document_view.xml index 40174612539..39b6908dc76 100644 --- a/addons/document_ics/document_view.xml +++ b/addons/document_ics/document_view.xml @@ -24,7 +24,7 @@ - + diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index 22f50cb8e9a..8c606e4cca0 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -414,6 +414,8 @@ class openerp_dav_handler(dav_interface): # relative part, because ul is relative, anyway uparts=urlparse.urlparse(turi) turi=uparts[2] + if uparts[3]: + turi += ';' + uparts[3] if turi.startswith(ul): result.append( turi[len(self.parent.davpath):]) else: @@ -440,6 +442,8 @@ class openerp_dav_handler(dav_interface): def uri2local(self, uri): uparts=urlparse.urlparse(uri) reluri=uparts[2] + if uparts[3]: + reluri += ';'+uparts[3] if reluri and reluri[-1]=="/": reluri=reluri[:-1] return reluri diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py index 1b60ade698f..3a68fb04fed 100644 --- a/addons/document_webdav/webdav.py +++ b/addons/document_webdav/webdav.py @@ -167,6 +167,8 @@ def mk_prop_response(self, uri, good_props, bad_props, doc): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") @@ -246,6 +248,8 @@ def mk_propname_response(self,uri,propnames,doc): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") @@ -303,6 +307,8 @@ def mk_lock_response(self, uri, props): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') davpath = self.parent.get_davpath()