Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

I want to call a stored procedure/function of postgres while importing a csv file.

I have written a function in postgres which deletes some files in database. The function name is demo().

I want to call this function while importing the csv file so that while the record of csv file stores in the database the function of postgres should be called and some records to be deleted.

In simple, while I pressing the import button my postgres function should be called.

I have tried creating a button and called the function it works fine.

My .py code is 


@api.multi

def demo(self):

self.env.cr.execute("SELECT demo()")


My .xml code is 

<button name="demo" string="delete" type="object" />

I want same should be done while I pressing the import button.

How can I achieve this?

Thanks.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
3
Jul 16
5616
1
Agu 17
5802
0
Mei 17
3933
1
Jun 16
4522
1
Sep 15
10418