Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6594 มุมมอง

I want to send a confirmation email to my customer automatically when i click on 'confirm sale' in quotation. is it possible ??

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

hello 

inherit the button and pass the context "send_email" it will automatically send the mail to customer when quotation is confirm.

for eg. 

     <button name="action_confirm" id="action_confirm" string="Confirm Sale" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['sent'])]}" context="{'send_email': True}"/>

                    <button name="action_confirm" string="Confirm Sale" type="object" attrs="{'invisible': [('state', 'not in', ['draft'])]}" context="{'send_email': True}"/>


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Yes, it is possible.

You can override the action of the confirm button and do the necessary for sending the email.

class SaleOrder(models.Model):
_inherit = 'sale.order'

@api.multi
def action_confirm(self):
res = super(SaleOrder, self).action_confirm()
# do the coding here for sending the e-mail
return res

If you need to know how to send email from the code, refer to this blog:  Finding and sending e-mail templates in Odoo


Also, you can check the Automated actions,  activate the developer mode and navigate to Settings -> Technical -> Automation -> Automated Actions



Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 24
20883
How to install odoo 10 in ubuntu 20.04? แก้ไขแล้ว
1
ก.ย. 23
3684
3
พ.ค. 23
6285
7
เม.ย. 23
49656
Barcode scanner from mobile แก้ไขแล้ว
1
ธ.ค. 22
8346