콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
4296 화면

I want send invoice email from phyton code.  I need Account Invoice, Send By Mail Button simulate or working code. i checked account.invoice.py and that code just create ctx and wizard form. i cant find clean code about this.
Anyone can tell me, how can i send invoice mail with default mail template easy way ?

아바타
취소
베스트 답변

Hello,

Try Below code may be it's help you

template_id = self.env.ref('module_name.template_name')
if template_id:
self.env['mail.template'].sudo().browse(template_id.id).send_mail(self.id, force_send=True)

Thanks

아바타
취소
작성자 베스트 답변

Hi manish, thank your quick answer. I try your solution its worked, but i cant see email infos in invoice notes area? Also sent email without mail header footer.

i think your code wok similar test email template action.

or how can write email info to invoce notes similar send by mail button action?

아바타
취소