[MERGE] xrg webdav fix patch26

bzr revid: tfr@openerp.com-20110218100413-srm6jo0xxfr4756q
This commit is contained in:
Thibault Francois
2011-02-18 11:04:13 +01:00
6 changed files with 30 additions and 4 deletions
+11
View File
@@ -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
+4
View File
@@ -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)])
+4 -3
View File
@@ -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)
+1 -1
View File
@@ -24,7 +24,7 @@
<field name="inherit_id" ref="view_document_directory_form_1"/>
<field name="arch" type="xml">
<field name="report_id" position="replace">
<field name="report_id" domain="[('type', '=', 'ressource'),('model_id','=',parent.ressource_type_id)]"/>
<field name="report_id" domain="[('model_id','=',parent.ressource_type_id)]"/>
<separator string="ICS Calendar" colspan="4"/>
<field name="ics_domain"/>
<field name="ics_field_ids" colspan="4">
+4
View File
@@ -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
+6
View File
@@ -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()