mirror of
https://github.com/NaN-tic/trytond-electronic_mail_wizard-old.git
synced 2023-12-13 21:30:11 +01:00
Send email wizard start: load data in language when send a record
This commit is contained in:
parent
50cb922606
commit
0656940147
1 changed files with 7 additions and 0 deletions
|
@ -144,6 +144,13 @@ class GenerateTemplateEmail(Wizard):
|
|||
template = wizard.template[0]
|
||||
total = len(active_ids)
|
||||
|
||||
#load data in language when send a record
|
||||
if template.language and total == 1:
|
||||
record = Pool().get(template.model.model)(active_ids[0])
|
||||
language = Template.eval(template, template.language, record)
|
||||
with Transaction().set_context(language = language):
|
||||
template = Template(template.id)
|
||||
|
||||
default['from_'] = template.from_
|
||||
default['total'] = total
|
||||
default['template'] = template.id
|
||||
|
|
Loading…
Reference in a new issue