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

How to add Sales Person (from SO) to recipient field on "Delivery: Send by Email" template?

Avatar
Zrušit
Nejlepší odpověď

Hi,

To do it from UI: (This will be deleted if you upgraded the stock module)

Enable developer mode and Go to settings -> Technical -> Email Templates, Search for "Delivery: Send by Email" and then open it, click on Edit and in Email Configuration tab, in To (Emails) paste the below:

{{object.sale_id.user_id.email_formatted}}

To do it using custom module, you need to 


<?xml version = "1.0"?>

<odoo>

<data noupdate="1">

<!-- Make the record updatable -->

<function name="write" model="ir.model.data">

<function name="search" model="ir.model.data">

<value eval=" [('name', '=', 'mail_template_data_delivery_confirmation'), ('module', '=', 'stock')] "/>

</function>

<value eval="{'noupdate': False}"/>

</function>



<!-- Inherit Email template -->

<record id="stock.mail_template_data_delivery_confirmation" model="mail.template">

<field name="email_to">${object.sale_id.user_id.email_formatted|safe}</field>

</record>



<!-- Set the record inupdatable -->

<function name="write" model="ir.model.data">

<function name="search" model="ir.model.data">

<value eval="[('name', '=', 'mail_template_data_delivery_confirmation'), ('module', '=', 'stock')] "/>

</function>

<value eval="{'noupdate': True} "/>

</function>

</data>

</odoo>

Avatar
Zrušit
Autor Nejlepší odpověď

Thank you very much!

I testes from UI and looks like it required id to work. Like 

${object.sale_id.user_id.id}

I need to test same with custom module.

For mean time, is possible to add multiple recipient from UI?

Avatar
Zrušit

Yes you can add multiple recipient from UI.

Related Posts Odpovědi Zobrazení Aktivita
1
úno 24
2660
1
čvc 23
3542
3
pro 23
19242
1
úno 22
6312
0
srp 21
2671