Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3528 Tampilan

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?


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Jul 16
2671
0
Mei 15
3547
1
Mar 15
5141
4
Des 15
6711
1
Jun 24
3184