Skip to content

Instantly share code, notes, and snippets.

@sehrishnaz
Last active October 2, 2019 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehrishnaz/bbe952a0a6e299cfa5daa09c41d61c68 to your computer and use it in GitHub Desktop.
Save sehrishnaz/bbe952a0a6e299cfa5daa09c41d61c68 to your computer and use it in GitHub Desktop.
self.env.cr.execute(""" CREATE TABLE IF NOT EXISTS your_table(
count decimal, mean decimal, std decimal, min decimal, twentyfive decimal,
fifty decimal, seventyfive decimal, max decimal, cv decimal,
uid integer, report_type text,name text)""")
self.env.cr.commit()
csv_file= open(filepath,"r")
columns=['count','mean','std','min','twentyfive','fifty','seventyfive','max','cv','uid','report_type','name']
self.env.cr.copy_from(csv_file, 'your_table', sep='|', columns=columns)
self.env.cr.commit()
csv_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment