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

How to call python function in onclick of calendar view

By
anu
on 10/20/14, 2:56 AM 1,875 views

I have a calendar view which displays apointment deatils for the customer.I want to edit my calendar view so that it will call a python function when i click on a perticular appointment created.Any one please help me

0

Hello,

Direct Python function calling upon click on Calender view, its not possible. The reason of that is Odoo is a total distributed, 3 tire architecture. You need to use standard API functions.

Can you explain your requirement in details and tell me what do you exactly want ? So I can assist you better.

One example of how you can achieve your purpose. 

1) You can ineherit Create method in your module, so when any appointment created your python function will be called.

2) You can ineherit Write method in your module, so when any appointment edited your python function will be called and in that function, you can write your custom code.

Waiting for your answer.

Hi Hiren thanks for your quick reply. I want to pop up my custom template when i click on my calendar view.Now i loads my custom template on side bar label action click.i am pasting my code here Create appointment.action and my java script is instance.web.client_actions.add('appointment.action', 'instance.Appointment'); instance.Appointment = instance.web.Widget.extend({ start: function() { ...................... .............................. self.$el.append(QWeb.render("Customer",{products:self.products,departments:self.departments,states:self.states,sales_reps:self.sales_reps,sequence:self.sequence,staff_id:self.staff_id,model:model1, 'showroom':self.showroom,'state':self.state,'employee_id':self.employee_id,'showrooms_for_state':self.showrooms_for_state})); }); Can you please help me!!

anu
on 10/20/14, 4:41 AM

any updates

anu
on 10/22/14, 4:40 AM

Actually i want to load my custom template when i click on my calendar view

anu
on 10/22/14, 4:51 AM

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: 10/20/14, 2:56 AM
Seen: 1875 times
Last updated: 3/16/15, 8:10 AM