Before Commit : - Sometimes user breaks their Mail/SMS templates and have no way to go back to the original one easily. They don't have any option to reset the template. After Commit : - Added new "Reset Template" button - now user can reset the Mail/SMS template to its first version. - also it will update the translation of the template - added New "Reset Mail Templates/Reset SMS Templates" action to edit multiple templates task- 2231977 closes odoo/odoo#83759 Related: odoo/upgrade#3674 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
34 lines
1.5 KiB
XML
34 lines
1.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="mail_template_reset_view_form" model="ir.ui.view">
|
|
<field name="name">mail.template.reset.view.form</field>
|
|
<field name="model">mail.template.reset</field>
|
|
<field name="priority">1000</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<div>
|
|
Are you sure you want to reset these email templates to their original configuration? Changes and translations will be lost.
|
|
</div>
|
|
<footer>
|
|
<button string="Proceed" class="btn btn-primary" type="object" name="reset_template" data-hotkey="q"/>
|
|
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z"/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_template_reset_action" model="ir.actions.act_window">
|
|
<field name="name">Reset Mail Template</field>
|
|
<field name="res_model">mail.template.reset</field>
|
|
<field name="binding_model_id" ref="mail.model_mail_template"/>
|
|
<field name="binding_view_types">list</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">new</field>
|
|
<field name="context">{
|
|
'default_template_ids': active_ids
|
|
}</field>
|
|
<field name="view_id" ref="mail_template_reset_view_form"/>
|
|
</record>
|
|
</odoo>
|