Odoo Help


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.


How to call a function/stored procedure of postgres while importing?

Uppili Arivukkannu
on 7/4/16, 2:46 AM 297 views

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 


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?


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)


Asked: 7/4/16, 2:46 AM
Seen: 297 times
Last updated: 7/4/16, 2:56 AM