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

Hello,

I created a mail template to explain to an employee why his leave was refused, but,when the mail is sent ...there is no explanation in it.

Here's my field, which is not empty (fill with a default function):

'refusal_explanation': fields.text('Refusal Explanation'), 

and here's my template:

<record id="email_template_conge_refused" model="email.template">
<field name="name">leave state - Refused</field>
<field name="email_from">openerp@cesbron.com</field>
<field name="subject">[what you asked] - Refused</field>
<field name="email_to">${object.employee_id.work_email}</field>
<field name="auto_delete" eval="True"/>
<field name="model_id" ref="cesbron_hr13.model_hr_holidays"/>
<field name="body_html"><![CDATA[
<p>Hello</p>
<p> Your leave from ${object.date_from} to ${object.date_to} was modified by your superior.</p>
<p> The state is now "REFUSED"!!</p>
 
<p>Explanation: ${object.refusal_explanation}</p>

<p>best regards,</p>
<p>${object.employee_id.parent_id.name}</p>
]]></field>
</record>

I know there is something in refusal_explanation, "you didn"t say please", but the result is:

Hello

your leave from .............

the state is now "REFUSED!!"

explanation:                          <= and here should be write "you didn't say please"

best regards

some name.


My field is in the current object and is not empty that's why i don't understand why it doesn't apear in the mail ( I tried with a fields.char too....didn't work)

Someone can explain me why or what can I do to resolve my problem ?


아바타
취소

You have added the field to hr.holidays model right? Have you checked without default function? I mean by entering some text manually? May be problem with default function.

작성자

Yeah I tried manually too, and I have the same result. I can see my field content in the view, but not in the mail ...

If you are trying to set a template for employee holiday table, then the model used is wrong. ()

Go to Settings --> Technical --> Email --> Template, Open your record, and check your value with Dynamic value builder and Preview in it.

작성자

No it's the right model ... thanks to your advices, it seems to be an other issue...the line "explanation:${object.refusal_explanation}" doesn't want to be added to my template ... so i deleted all my templates and re-update them ...and it still don't work >.

작성자

OK i found my problem ...there was a "noupdate="1" "at the start of my file ... that's why the update wasn't done... how did i Miss that thing ...

관련 게시물 답글 화면 활동
8
7월 24
24336
1
9월 21
4316
0
11월 20
3923
7
9월 19
36451
1
3월 15
7260