PURPOSE Concatenate feedback message and tracking when marking a lead as lost. This currently generates 2 consecutive message about the same change, having a single one is better from an UI point of view. SPECIFICATIONS Allow to link a body to a value change tracking. Tracking is currently done by accumulating changes in a structure (see ``env.cr.precommit.data`` usage with ``mail.tracking.<name>`` key). In the end those values are used to generate a message with tracking value and a subtype. In this commit we allow to manually set a body used as a message for the tracking message, adding a new ``mail.tracking.message.<name>`` key. It is used when posting or logging the tracking message, simply propagated as body to ``message_post`` or ``message_log``. In crm we use this when losting a lead through the dedicated wizard. A bit of custom html allows to have a nice display. Task-2671709 Part-of: odoo/odoo#78648
29 lines
1.3 KiB
XML
29 lines
1.3 KiB
XML
<?xml version="1.0"?>
|
|
<odoo>
|
|
<record id="crm_lead_lost_view_form" model="ir.ui.view">
|
|
<field name="name">crm.lead.lost.form</field>
|
|
<field name="model">crm.lead.lost</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Lost Reason">
|
|
<group>
|
|
<field name="lost_reason_id" options="{'no_create_edit': True}" />
|
|
</group>
|
|
<field name="lost_feedback" placeholder="What went wrong ?"/>
|
|
<footer>
|
|
<button name="action_lost_reason_apply" string="Submit" type="object" class="btn-primary" data-hotkey="q"/>
|
|
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z"/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="crm_lead_lost_action" model="ir.actions.act_window">
|
|
<field name="name">Lost Reason</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">crm.lead.lost</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="view_id" ref="crm_lead_lost_view_form"/>
|
|
<field name="target">new</field>
|
|
</record>
|
|
</odoo>
|