Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3317 Zobrazení

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')]                    

 


Avatar
Zrušit
Nejlepší odpověď

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


Avatar
Zrušit

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.

Autor Nejlepší odpověď

Thank you Arian :) 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
dub 25
4632
1
dub 25
4511
0
kvě 24
1422
0
pro 22
1499
0
říj 22
1830