RATIONALE
Mail template model holds a field telling odoo mail engine to automatically
add the current user's signature to the body. Its use depends on the use
case
* using the template in the composer on a single record: it is displayed
in the rendered template in the composer, meaning people could change it.
This behavior is interesting as it allows to see the email content;
* using the template in the composer in mass mail mode: it is not displayed
as only the raw jinja is displayed. It is therefore not obvious that it
will be appended to the body of the mail. People could add it manually and
have 2 signatures as a result;
A mechanism automatically adding a signature to sent emails when posting a
message is already implemented and is based on template existence. If a
template has been used when posting, no signature is added in sent emails.
Otherwise it is automatically added. This behavior should not change.
Behavior will therefore be
* use a template -> specify signature usage in it manually through jinja;
* do not use a template -> signature added in sent emails;
SPECIFICATIONS
Remove user_signature.
Update template body accordingly. In customer oriented templates that are using
it and do not already contain it, manually add a call to user.signature within
the jinja code. When set to False, just remove its declaration.
Quickly clean some signature integration.
LINKS
Task ID 2089252
Community PR odoo/odoo#39482
Enterprise PR odoo/enterprise#6459
Upgrade PR odoo/upgrate#761
Related: odoo/enterprise#6459
Related: odoo/upgrade#761
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
124 lines
6.3 KiB
XML
124 lines
6.3 KiB
XML
<?xml version="1.0" ?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<record id="res_partner_view_form_inherit_mail" model="ir.ui.view">
|
|
<field name="name">res.partner.view.form.inherit.mail</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='email']" position="replace">
|
|
<field name="is_blacklisted" invisible="1"/>
|
|
<label for="email" class="oe_inline"/>
|
|
<div class="o_row o_row_readonly">
|
|
<i class="fa fa-ban" style="color: red;" role="img" title="This email is blacklisted for mass mailing"
|
|
aria-label="Blacklisted" attrs="{'invisible': [('is_blacklisted', '=', False)]}" groups="base.group_user"></i>
|
|
<field name="email" widget="email"/>
|
|
</div>
|
|
</xpath>
|
|
<xpath expr="//sheet" position="after">
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="res_partner_view_kanban_inherit_mail" model="ir.ui.view">
|
|
<field name="name">res.partner.view.kanban.inherit.mail</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
|
|
<field name="arch" type="xml">
|
|
<field name="type" position="after">
|
|
<field name="activity_state"/>
|
|
</field>
|
|
<xpath expr="//div[hasclass('oe_kanban_details')]" position="inside">
|
|
<div class="mt-auto">
|
|
<field name="activity_ids" widget="kanban_activity"/>
|
|
</div>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="res_partner_view_search_inherit_mail" model="ir.ui.view">
|
|
<field name="name">res.partner.view.search.inherit.mail</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_res_partner_filter"/>
|
|
<field name="arch" type="xml">
|
|
<filter name="inactive" position="after">
|
|
<filter invisible="1" string="Late Activities" name="activities_overdue"
|
|
domain="[('activity_ids.date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
|
|
help="Show all records which has next action date is before today"/>
|
|
<filter invisible="1" string="Today Activities" name="activities_today"
|
|
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
|
|
domain="[('activity_ids.date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<separator/>
|
|
</filter>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="res_partner_view_activity" model="ir.ui.view">
|
|
<field name="name">res.partner.activity</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="arch" type="xml">
|
|
<activity string="Contacts">
|
|
<field name="id"/>
|
|
<templates>
|
|
<div t-name="activity-box">
|
|
<img t-att-src="activity_image('res.partner', 'image_128', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
|
|
<div>
|
|
<field name="name" display="full"/>
|
|
<field name="parent_id" muted="1" display="full"/>
|
|
</div>
|
|
</div>
|
|
</templates>
|
|
</activity>
|
|
</field>
|
|
</record>
|
|
|
|
<!--Definition of an email template with an empty body that will be used in partner mailing. Used to give a
|
|
basis for email recipients, name and to ease the definition of a further elaborated template. -->
|
|
<record id="email_template_partner" model="mail.template">
|
|
<field name="name">Partner Mass Mail</field>
|
|
<field name="model_id" ref="base.model_res_partner"/>
|
|
<field name="partner_to">${object.id}</field>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="lang">${object.lang}</field>
|
|
</record>
|
|
|
|
<!-- Add mail-defined activity view to standard action on partners to manage activities related to partner model -->
|
|
<record id="base.action_partner_form" model="ir.actions.act_window">
|
|
<field name="view_mode">kanban,tree,form,activity</field>
|
|
</record>
|
|
<record id="base.action_partner_customer_form" model="ir.actions.act_window">
|
|
<field name="view_mode">kanban,tree,form,activity</field>
|
|
</record>
|
|
<record id="base.action_partner_supplier_form" model="ir.actions.act_window">
|
|
<field name="view_mode">kanban,tree,form,activity</field>
|
|
</record>
|
|
|
|
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
|
|
<act_window name="Send email"
|
|
res_model="mail.compose.message"
|
|
binding_model="res.partner"
|
|
binding_views="list"
|
|
view_mode="form"
|
|
target="new"
|
|
id="action_partner_mass_mail"
|
|
context="{
|
|
'default_composition_mode': 'mass_mail',
|
|
'default_partner_to': '${object.id or \'\'}',
|
|
'default_use_template': True,
|
|
'default_template_id': ref('email_template_partner'),
|
|
}"/>
|
|
|
|
<record id="email_template_partner" model="mail.template">
|
|
<field name="ref_ir_act_window" ref="action_partner_mass_mail"/>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|