minor changes
bzr revid: solanki.priyesh@gmail.com-20081217051228-wlc5dm63ewbr114o
This commit is contained in:
@@ -42,7 +42,7 @@ def _zippy(archive, fromurl, path, src=True):
|
||||
else:
|
||||
exclude = ['py','pyo','pyc']
|
||||
if (path.split('.')[-1] not in exclude) or (os.path.basename(path)=='__terp__.py'):
|
||||
archive.write(os.path.join(fromurl, path), path)
|
||||
archive.write(os.path.join(fromurl, path).encode(), path.encode())
|
||||
return True
|
||||
|
||||
def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
|
||||
@@ -59,7 +59,7 @@ def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
|
||||
if os.path.isdir(os.path.join(ad, module.name)):
|
||||
archname = StringIO.StringIO('wb')
|
||||
archive = PyZipFile(archname, "w", ZIP_DEFLATED)
|
||||
archive.writepy(os.path.join(ad, module.name))
|
||||
archive.writepy(os.path.join(ad, module.name).encode())
|
||||
_zippy(archive, ad, module.name, src=src)
|
||||
archive.close()
|
||||
val =archname.getvalue()
|
||||
|
||||
@@ -52,7 +52,7 @@ finish_fields = {
|
||||
|
||||
class move_module_wizard(wizard.interface):
|
||||
def createzip(self, cr, uid, data, context):
|
||||
return module_zip.createzip(cr, uid, data['id'], context, src=data['form']['include_src'])
|
||||
return module_zip.createzip(cr, uid, data['id'], context, src=data['form']['include_src'])
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
||||
@@ -410,12 +410,12 @@ class project_work(osv.osv):
|
||||
_order = "date desc"
|
||||
def create(self, cr, uid, vals, *args, **kwargs):
|
||||
if 'task_id' in vals:
|
||||
cr.execute('update project_task set remaining_hours=remaining_hours+%.2f where id=%s', (-vals.get('hours',0.0), vals['task_id']))
|
||||
cr.execute('update project_task set remaining_hours=remaining_hours+%.2s where id=%s', (-vals.get('hours',0.0), vals['task_id']))
|
||||
return super(project_work,self).create(cr, uid, vals, *args, **kwargs)
|
||||
|
||||
def write(self, cr, uid, ids,vals,context={}):
|
||||
for work in self.browse(cr, uid, ids, context):
|
||||
cr.execute('update project_task set remaining_hours=remaining_hours+%.2f+(%.2f) where id=%s', (-vals.get('hours',0.0), work.hours, work.task_id.id))
|
||||
cr.execute('update project_task set remaining_hours=remaining_hours+%.2f+(%.2s) where id=%s', (-vals.get('hours',0.0), work.hours, work.task_id.id))
|
||||
return super(project_work,self).write(cr, uid, ids, vals, context)
|
||||
|
||||
def unlink(self, cr, uid, ids, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user