Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

shall I let users see and save the figures which is made on Odoo?

By
vx2008
on 8/22/16, 9:48 AM 115 views

in .py file:

import matplotlib.pyplot as plt

....

datafile=fields.Binary(u'select Excel File',required=True)

@api.multi

def plotfig(self,cr):

file_like=io.BytesIO(base64.b64decode(self.datafile))

table=pandas.read_excel(file_like)

x=table.iloc[:,1]

y=table.iloc[:,2]

plt.plot(x,y)

plt.show()


Now the users can upload "excel" file onto "datafile", and when users click button "plotfig", odoo will read out data from "datafile", plot a figure and show it on odoo server; but because the figure is shown on odoo server, users can't see / save it; so how shall I let users see the figure and save it on users' PC?


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/22/16, 9:48 AM
Seen: 115 times
Last updated: 8/22/16, 11:06 AM