Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
7225 Lượt xem

i have a custom module in odoo 12 and i need to send mail automatically to users who assigned to do  work; When i saving the record

i have created the email template also

i already have 'create' function for generating the sequence number like

@api.model
def create(self, vals):
if vals.get('seq_name', _('New')) == _('New'):
vals['seq_name'] = self.env['ir.sequence'].next_by_code('test.sequence') or _('New')
result = super(Test, self).create(vals)
return result
how can i solve this, Can i write the mail sending code inside this function ???
Please help me to fix this


Ảnh đại diện
Huỷ bỏ

Most of the time we need to send an email after successfully completion of some tasks or event. To day I will show you how to send an email in odoo using button click.

Reference: https://goo.gl/z16PBZ

Câu trả lời hay nhất

You don't need to override the create method for sending the automatic email. You just need to configure automated action to send the email when record is created / updated.

Please follow the instruction given in the link: Automated Action .

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Thank you so much for the info.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

There is a way to create a stored procedure in Postgres to send an email and also assign it to a record, and you can use trigger on the table to fire the stored procedure. the stored procedure is the following: CREATE OR REPLACE FUNCTION [dbo].[SendPressedEmail_Trigger_sp] ( [p_id_in] [int] ) RETURNS TRIGGER AS $SendPressedEmail_Trigger_sp$ BEGIN DECLARE @p_id [int] , @p_mail [varchar](50) , @p_mail_subject [varchar](50) , @p_mail_message [varchar](max) , @p_mail_body [varchar](max) , @p_mail_user_id [int] , @p_mail_created_user_id [int] , @p_mail_status [varchar](10) , @p_mail_status_message [varchar](50) , @p_mail_date_sent [datetime] , @p_mail_last_sent_at [datetime] , @p_mail_delivered [bit] , @p_mail_error [bit] ; SET @p_mail_status = 0; SET @p_mail_delivered = 0; SET @p_mail_error = 0; SET

Ảnh đại diện
Huỷ bỏ

Looking for the best keyboard for investment banking? We've got you covered! Our best keyboard for investment banking post will tell you everything you need to know about keyboards for investment banking. Read on to learn more. https://hightechreviewer.com/best-keyboard-for-investment-banking/

The best tablets for construction drawings are the ones that are durable, dependable, and offer a wide range of features. Of course, not all tablets are created equal. Read more here to find out which tablet is the best for your needs. https://nonstoptechno.com/best-tablet-for-construction-drawings/

Câu trả lời hay nhất

Thanks for asking this ... even my query is resolved .... :) https://vidmateapp.win https://tataindicombroadband.in

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Thanks for asking this ... even my query is resolved .... :)

Ảnh đại diện
Huỷ bỏ
You are on the wrong place.

On Wed, Nov 13, 2019 at 1:59 PM smithclarkson001 <installvidmate02@gmail.com> wrote:
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 21
1924
0
thg 1 17
2879
3
thg 2 25
8556
Automated emails Đã xử lý
3
thg 9 24
7948
2
thg 7 24
4321