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

Good morning, I want a list of followers (email address) to be added at the beginning of every email coming from odoo, regardless of whether it is an internal user or not.
I found this code,

% for follower in object.message_follower_ids:

${follower.name} ${follower.email}

% endfor


 but I can't add it to the email template. Can anyone suggest how to get it?
I cannot modify files (enterprise version), only settings possible from the backend.

아바타
취소
베스트 답변

check the below steps:

  1. In your any_think method, you are defining data as an empty dictionary. Then, you're assigning the result of self.read()[0] to data['form']. This implies that you want to pass the form data to the report. Make sure the read() method is returning the expected values. You can add some print statements to check the data['form'] before passing it to the report.

  2. The line return self.env.ref('nidal.wizreport').report_action(self, data=data) suggests that you have defined a report template with the XML ID 'nidal.wizreport'. Confirm that the XML ID is correct and that the report template exists. Also, check the report template to ensure it is properly configured to handle the data passed through the data variable.

  3. In the XML view of your wizard, the id attribute is missing for the field elements. Make sure to provide unique IDs for each field, as they are necessary for proper functioning and data binding.

  4. Check the report design and the report template associated with the XML ID 'nidal.wizreport'. Verify that the report template is correctly defined and that it handles the data passed through the data variable. Make sure you are using the correct placeholders and syntax to display the data in the report.


아바타
취소
베스트 답변

Hi,

You can create a custom template in the xml file 










<?xml version="1.0" encoding="UTF-8"?>
<odoo>
        <record id="template_id" model="mail.template">
            <field name="name">Template name</field>
            <field name="model_id" ref="module_name.model_model_name"/>
            <field name="auto_delete" eval="False"/>
            <field name="email_from">{{ (object.env.user.login) }}</field>
            <field name="subject">Type your own subject</field>
            <field name="body_html">
                <![CDATA[
               <p>
               //Write your email details
               </p>
               ]]>
            </field>
        </record>
</odoo>



mail_template = self.env.ref(module_name.tempalte_id)
mail_template.send_mail(self
.id, force_send=True,email_values={
                             
'email_to':// email address})


If you have multiple people you can create it has in loop statements

Hope it helps

아바타
취소
관련 게시물 답글 화면 활동
0
12월 24
1256
1
1월 23
2864
1
3월 21
3491
1
10월 20
4499
4
7월 17
7503