[merge] fix-shebang from 5.0 to trunk
bzr revid: hmo@tinyerp.com-20091202091102-r509b0bgogyul6yx bzr revid: xmo@tinyerp.com-20091202101458-6a1mo240grkld6do
This commit is contained in:
commit
cf13b6c36e
|
@ -87,7 +87,7 @@ class Graph(dict):
|
|||
|
||||
## and we update the default values with values from the database
|
||||
additional_data.update(dict([(x.pop('name'), x) for x in cr.dictfetchall()]))
|
||||
|
||||
|
||||
for package in self.values():
|
||||
for k, v in additional_data[package.name].items():
|
||||
setattr(package, k, v)
|
||||
|
@ -613,6 +613,16 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs):
|
|||
if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'):
|
||||
has_updates = True
|
||||
for kind in ('init', 'update'):
|
||||
if package.state=='to upgrade':
|
||||
# upgrading the module information
|
||||
modobj.write(cr, 1, [mid], {
|
||||
'description': package.data.get('description', ''),
|
||||
'shortdesc': package.data.get('name', ''),
|
||||
'author': package.data.get('author', 'Unknown'),
|
||||
'website': package.data.get('website', ''),
|
||||
'license': package.data.get('license', 'GPL-2'),
|
||||
'certificate': package.data.get('certificate') or None,
|
||||
})
|
||||
for filename in package.data.get('%s_xml' % kind, []):
|
||||
logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, filename))
|
||||
name, ext = os.path.splitext(filename)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
|
|
|
@ -734,7 +734,7 @@ class related(function):
|
|||
t_id=t_data['id']
|
||||
t_data = t_data[self.arg[i]]
|
||||
if t_id:
|
||||
obj.pool.get(field_detail['object']).write(cr,uid,[t_id],{args[-1]:values})
|
||||
obj.pool.get(field_detail['object']).write(cr,uid,[t_id],{args[-1]:values}, context=context)
|
||||
|
||||
def _fnct_read(self, obj, cr, uid, ids, field_name, args, context=None):
|
||||
self._field_get2(cr, uid, obj, context)
|
||||
|
@ -757,7 +757,7 @@ class related(function):
|
|||
except:
|
||||
t_data = False
|
||||
break
|
||||
if field_detail['type'] in ('one2many', 'many2many'):
|
||||
if field_detail['type'] in ('one2many', 'many2many') and i != len(self.arg) - 1:
|
||||
t_data = t_data[self.arg[i]][0]
|
||||
else:
|
||||
t_data = t_data[self.arg[i]]
|
||||
|
@ -773,6 +773,12 @@ class related(function):
|
|||
for r in res:
|
||||
if res[r]:
|
||||
res[r] = (res[r], ng[res[r]])
|
||||
elif self._type in ('one2many', 'many2many'):
|
||||
for r in res:
|
||||
if res[r]:
|
||||
res[r] = [x.id for x in res[r]]
|
||||
|
||||
|
||||
return res
|
||||
|
||||
def __init__(self, *arg, **args):
|
||||
|
|
|
@ -89,14 +89,14 @@ class report_rml(report_int):
|
|||
def create(self, cr, uid, ids, datas, context):
|
||||
xml = self.create_xml(cr, uid, ids, datas, context)
|
||||
xml = tools.ustr(xml).encode('utf8')
|
||||
if datas.get('report_type', 'pdf') == 'raw':
|
||||
return xml
|
||||
report_type = datas.get('report_type', 'pdf')
|
||||
if report_type == 'raw':
|
||||
return (xml,report_type)
|
||||
rml = self.create_rml(cr, xml, uid, context)
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
ir_actions_report_xml_obj = pool.get('ir.actions.report.xml')
|
||||
report_xml_ids = ir_actions_report_xml_obj.search(cr, uid, [('report_name', '=', self.name[7:])], context=context)
|
||||
self.title = report_xml_ids and ir_actions_report_xml_obj.browse(cr,uid,report_xml_ids)[0].name or 'OpenERP Report'
|
||||
report_type = datas.get('report_type', 'pdf')
|
||||
create_doc = self.generators[report_type]
|
||||
pdf = create_doc(rml, title=self.title)
|
||||
return (pdf, report_type)
|
||||
|
|
|
@ -457,4 +457,4 @@ if __name__=="__main__":
|
|||
print 'Usage: rml2html input.rml >output.html'
|
||||
print 'Try \'rml2html --help\' for more information.'
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -287,11 +287,8 @@ class db(netsvc.ExportService):
|
|||
return True
|
||||
|
||||
def exp_db_exist(self, db_name):
|
||||
try:
|
||||
db = sql_db.db_connect(db_name)
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
## Not True: in fact, check if connection to database is possible. The database may exists
|
||||
return bool(sql_db.db_connect(db_name))
|
||||
|
||||
def exp_list(self):
|
||||
db = sql_db.db_connect('template1')
|
||||
|
|
|
@ -170,6 +170,7 @@ class Cursor(object):
|
|||
sqllogs[type].clear()
|
||||
sum = timedelta(microseconds=sum)
|
||||
log("SUM %s:%s/%d [%d]" % (type, str(sum), self.sql_log_count, sql_counter))
|
||||
sqllogs[type].clear()
|
||||
process('from')
|
||||
process('into')
|
||||
self.sql_log_count = 0
|
||||
|
@ -315,6 +316,15 @@ class Connection(object):
|
|||
def serialized_cursor(self):
|
||||
return self.cursor(True)
|
||||
|
||||
def __nonzero__(self):
|
||||
"""Check if connection is possible"""
|
||||
try:
|
||||
cr = self.cursor()
|
||||
cr.close()
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
_dsn = ''
|
||||
for p in ('host', 'port', 'user', 'password'):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue