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

Hi everyone, I'am creating an automated action To send an email when updating a field, pls help me find the correct syntax.

field name : State


name="name">demande d'embauche approuvée           
name="model_id" ref="employee_recruitment_app.model_staff_recruitment"/>           
name="active"eval="True"/>           
name="trigger">on_write           
name="trigger_field_ids">state           
name="state">email           
name="template_id" ref="demande_embauche_approuvee"/>           
name="filter_pre_domain">[('state','=','draft')]           
name="filter_domain">[('state','=','approve')]                    

 


아바타
취소
베스트 답변

You can achieve this by overriding base.automation model using python:

from odoo import api, models

class BaseAutomation(models.Model):
_inherit = 'base.automation'

@api.onchange('field_you_want')
    def _send_email(self):
# email sending code here


아바타
취소

Or if you want to do it after updating it or based on the value of updated field you can override write method as wel.

작성자 베스트 답변

Thank you Arian :) 

아바타
취소
관련 게시물 답글 화면 활동
1
4월 25
4748
1
4월 25
4609
0
5월 24
1520
0
12월 22
1575
0
10월 22
1889