Hello, Does anyone can help me how to create a file? I have my tree view with data on it. Now i wonder how can i write it on a file so that user can have c copy on it in a .DAT file. Any one knows?
I tried to make a function, but it the web pop an error message:
fo = open(home+"\\persons.DAT","wb")
IOError: [Errno 13] Permission denied: '~user\\persons.DAT'
Here is my method:
def write_file(self,cr,uid,ids,context=None):
fo = {}
home = os.path.expanduser('~user')
fo = open(home+"\\persons.DAT","wb")
active_id = self.search(cr,uid,[])
for list in self.browse(cr,uid,active_id,context=context):
fo.write(list.id+","+list.person_id.id)
return fo
Any help is much appreciated.