Skip to Content
Menu
This question has been flagged

I would like to add an button on the website to the cart view, that basically would allow the customer to receive a PDF quotation of the current cart products to his/her email. I know how to create an email template, and thought of making a server action that would use the template and send the email. I also managed to create a button to the website. However, I don't know how to call the server action from the website, or if it's even possible in this case where the action is send an email type. If the server action executes python code, there is the "Available on the Website" button available. But not for the send an email action. Does this mean that this type of server action cannot be called from the website?

Anyway, as I currently see it I have three options:

  1. Somehow call the send an email server action from the website? How?
  2. Call an execute python code action and use that to call the send an email action? (seems shaky)
  3. Abandon the server action approach, and figure some other way to do this?

Any help will be greatly appreciated as always. Even if you can just point me on the right direction on options one, two and three above. Thank you! 

Avatar
Discard
Best Answer

Hi Mikko!

If you want a customer to have the possibility to receive a quote after clicking a button on the website, you would need to write a controller for that - you cannot simply call the python function that is defined in the backend on the model. 

Also, we need to assume, that this approach can work only if the customer is logged in or already inputted the delivery address (meaning the quotation is linked to a different customer than a Public User).

What could be easier to implement though would be to redirect the customer to the portal view of the quotation (as a shopping cart is basically a sale.order in status quotation), and there the customer can decide to download PDF or print it.

Hope I managed to point you to the right direction

Ivana from edoo.is

Avatar
Discard
Author

Hi Ivana. Thank you very much for your advise, this does help a lot. I will ask about the controller from our Odoo partner, and we have the other possible solution that you suggested as a backup plan.

Related Posts Replies Views Activity
2
Sep 24
2744
1
May 24
651
1
May 24
916
1
Dec 23
913
2
Dec 22
3999