I have custom CSS and I want to call it on mail.template body_html. how to do it?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
Create a new XML file and add it to the __openerp__.py file as dependency. An example of such a template:
<openerp>
<data noupdate="1">
<record id="your_template_email" model="mail.template">
<field name="name">Template title</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="subject">${object.event_id.name} - Reminder</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<style>
span.oe_mail_footer_access {
display:block;
text-align:center;
color:grey;
}
</style>
<div style="border-radius: 2px; max-width: 1200px; height: auto;margin-left: auto;margin-right: auto;background-color:#f9f9f9;">
<div style="height: auto;margin-left:12px;margin-top:30px;">
<p>ANY TEXT YOU WANT HERE!</p>
</div>
</div>
]]>
</field>
</record>
</data>
</openerp>
As you can see you can add CSS etc in it. An important note is to add data noupdate="1" in it though! So the template is never reloaded.
Hi Aurel,
I am not sure if that is possible but the alternate way is to use the style attribute in the tags in the template.
oh sad :( thanks Sudhir
Hi guys! Is there still no other possibility?
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
RekisteröidyAiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
---|---|---|---|---|
|
5
jouluk. 22
|
12913 | ||
|
2
jouluk. 24
|
7009 | ||
How to ORDER BY? [Odoo 10]
Ratkaistu
|
|
2
marrask. 24
|
27413 | |
|
2
toukok. 24
|
6759 | ||
|
3
maalisk. 24
|
6208 |