Community mailing list archives
Re: how to save file * .txt ?by
I think you can add a python code to save your file into a specified folder or create a wizard which will let you choose the location.
should let you to it :)
body = """No,Customer name,Customer surname\n"""
for order in self:
product = self.env['model_name'].browse([('id','=',self.id)])
order_line = """%s,%s,%s\n"""%(a, product.customer_name, product.customer_surname)
body += """%s""" %(order_line)
a = a + 1
#Creating and saving csv
filecontent = body
print('Creating CSV ...')
name = ('orders_'+subnow+'.csv')
print '== name ======================================================================================='
print ' ', name
file = open(name,'w+')
print 'file ',name,' opened ;)'
print '== file created ==============================================================================='
print('Something went wrong! Empty file?')
It's just an example but it may give you some ideas :)
On 11 February 2016 at 15:11, omar frikha <firstname.lastname@example.org> wrote:
how to create function save as??2016-02-11 15:42 GMT+01:00 Robert Amberwich <email@example.com>:So if you were developed that module how's it possible that you don't know how to save it ?I don't understand, or maybe there is another Omar Frikha who don't know how to ?On 11 February 2016 at 13:57, omar frikha <firstname.lastname@example.org> wrote:I've developed a new module that allows to generate a txt file I can save this file in my pc and not in the server