[MERGE] merge with main branch

bzr revid: mra@tinyerp.com-20100316123724-zowixvrdtiko72fb
This commit is contained in:
mra (Open ERP)
2010-03-16 18:07:24 +05:30
4 changed files with 18 additions and 23 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ class ir_action_report_xml(osv.osv):
res[data.get('id')] = False
return res
def _model_search(self, cr, uid, obj, name, args):
def _model_search(self, cr, uid, obj, name, args, context={}):
if not len(args):
return []
model_id= args[0][2]
+3 -4
View File
@@ -64,8 +64,7 @@ class document_directory(osv.osv):
def _get_root_directory(self, cr,uid, context=None):
objid=self.pool.get('ir.model.data')
try:
mid = objid._get_id(cr, uid, 'document', 'dir_root')
return False # TODO: check why not display root dir
mid = objid._get_id(cr, uid, 'document', 'dir_root')
if not mid:
return False
except Exception, e:
@@ -199,8 +198,8 @@ class document_directory(osv.osv):
path.append(duri[0])
duri = duri[1:]
did = nid[0]
return (nodes.node_dir(path, nparent,ncontext,self.browse(cr,uid,did, context)), duri)
root_node = did and self.browse(cr,uid,did, context) or False
return (nodes.node_dir(path, nparent,ncontext, root_node), duri)
nid = self.search(cr,uid,[('parent_id','=',did),('name','=',duri[0]),('type','=','ressource')], context=context)
+10 -11
View File
@@ -49,18 +49,17 @@ class node_context(object):
context """
cached_roots = {}
def __init__(self, cr, uid, context=None):
# we don't cache the cr!
def __init__(self, cr, uid, context=None):
self.dbname = cr.dbname
self.uid = uid
self.context = context
self._dirobj = pooler.get_pool(cr.dbname).get('document.directory')
assert self._dirobj
self.rootdir = self._dirobj._get_root_directory(cr,uid,context)
self.rootdir = False #self._dirobj._get_root_directory(cr,uid,context)
def get_uri(self, cr, uri):
""" Although this fn passes back to doc.dir, it is needed since
it is a potential caching point """
it is a potential caching point """
(ndir, duri) = self._dirobj._locate_child(cr,self.uid, self.rootdir,uri, None, self)
while duri:
ndir = ndir.child(cr, duri[0])
@@ -168,23 +167,23 @@ class node_dir(node_class):
our_type = 'collection'
def __init__(self,path, parent, context, dirr, dctx=None):
super(node_dir,self).__init__(path, parent,context)
self.dir_id = dirr.id
self.dir_id = dirr and dirr.id or False
#todo: more info from dirr
self.mimetype = 'application/x-directory'
# 'httpd/unix-directory'
self.create_date = dirr.create_date
self.domain = dirr.domain
self.res_model = dirr.ressource_type_id and dirr.ressource_type_id.model or False
self.create_date = dirr and dirr.create_date or False
self.domain = dirr and dirr.domain or []
self.res_model = dirr and dirr.ressource_type_id and dirr.ressource_type_id.model or False
# TODO: the write date should be MAX(file.write)..
self.write_date = dirr.write_date or dirr.create_date
self.write_date = dirr and (dirr.write_date or dirr.create_date) or False
self.content_length = 0
if dctx:
self.dctx.update(dctx)
dc2 = self.context.context
dc2.update(self.dctx)
dc2['dir_id'] = self.dir_id
self.displayname = dirr.name
if dirr.dctx_ids:
self.displayname = dirr and dirr.name or False
if dirr and dirr.dctx_ids:
for dfld in dirr.dctx_ids:
try:
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
+4 -7
View File
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!--
Resource: project.project
-->
<record id="base.main_company" model="res.company">
<field name="project_time_mode_id" ref="product.uom_hour"></field>
</record>
<!-- Task Types -->
<record id="project_tt_specification" model="project.task.type">
<field name="sequence">1</field>
@@ -26,7 +26,7 @@
<field name="sequence">4</field>
<field name="name">Merge</field>
</record>
<!-- Projects -->
<record id="project_project_9" model="project.project">
<field name="warn_manager">1</field>
@@ -39,7 +39,6 @@
<field name="priority">10</field>
<field name="parent_id" ref="project_project_9"/>
<field name="name">Study + Prototype</field>
<field model="account.analytic.account" name="category_id" search="[('name','=', 'Seagate P1')]"/>
<field name="manager" ref="base.user_root"/>
<field eval="[(6, 0, [ref('project_tt_specification'),ref('project_tt_development')])]" name="type_ids"/>
</record>
@@ -47,7 +46,6 @@
<field name="priority">20</field>
<field name="parent_id" ref="project_project_9"/>
<field name="name">Specific Developements</field>
<field model="account.analytic.account" name="category_id" search="[('name','=', 'Seagate P1')]"/>
<field name="manager" ref="base.user_root"/>
<field eval="[(6, 0, [ref('project_tt_specification'), ref('project_tt_development')])]" name="type_ids"/>
</record>
@@ -55,11 +53,10 @@
<field name="priority">30</field>
<field name="parent_id" ref="project_project_9"/>
<field name="name">Install, data import, configuration</field>
<field model="account.analytic.account" name="category_id" search="[('name','=', 'Seagate P1')]"/>
<field name="manager" ref="base.user_root"/>
<field eval="[(6, 0, [ref('project_tt_development')])]" name="type_ids"/>
</record>
<!-- Tasks -->
<record id="project_task_116" model="project.task">
<field name="planned_hours">38.0</field>