Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
8209 Vistas

my email templaes like this :

    <!-- Email template for holiday -->
    <record id="holidays_require_email" model="email.template">
        <field name="name">holiday require</field>
        <field name="model_id" ref="hr_holidays.model_hr_holidays"/>
        <field name="email_from">holiday@test.com</field>
        <field name="email_to">
            <![CDATA[
                % if len(object.employee_id.parent_id):
                  'codefans3@gmail.com '
                % endif
                % for p_id in object.employee_id.parent_id:
                ${p_id.work_email}  
                % endfor
            ]]>
            </field>
        <field name="subject">Holiday require</field>
        <field name="body_html"><![CDATA[

${object.user_id.partner_id.name} have a leave action, please login in opnerp to comfirm




${object.web_url}

]]></field> </record>

but this did not work.
the field parent_id is many2many

how can i do with this

thanks

Avatar
Descartar
Mejor respuesta

Hi

Of course you can send mail to many recipient

but you need to add , commas too

add emails after , commas

thanks
Sandeep

Avatar
Descartar
Autor

ok, thanks.

now i use a function field to store email.

if can i use this:

<field name="email_to"> <![CDATA[ % if len(object.employee_id.parent_id): 'codefans3@gmail.com ' % endif % for p_id in object.employee_id.parent_id: ${p_id.work_email}
% endfor ]]> </field>

Publicaciones relacionadas Respuestas Vistas Actividad
4
jul 24
19060
1
jul 25
532
5
may 25
17925
0
abr 25
994
1
abr 25
1444