Skip to content

Commit

Permalink
[FIX] mail_forward: Render message actions correctly with callComponent
Browse files Browse the repository at this point in the history
Currently, Odoo only renders the callComponent for quick actions (2 or 3 actions). However, the remaining actions, rendered as DropdownItem, do not invoke the callComponent.
This commit ensures that the rendering is consistent in both cases.

Complementary to: #131426

TODO: This code should be removed once the issue is fixed in the Odoo core.
        odoo/odoo#194643
  • Loading branch information
carlos-lopez-tecnativa committed Jan 22, 2025
1 parent e13886b commit ea11305
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions mail_forward/static/src/core/common/message.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<templates xml:space="preserve">
<t t-inherit="mail.Message.actions" t-inherit-mode="extension">
<!--
In the DropdownItem, render the callComponent if it is defined,
similar to how it is rendered for quick actions.
Currently, Odoo only renders the callComponent for quick actions (2 or 3 actions).
However, the remaining actions, rendered as DropdownItem, do not invoke the callComponent.
See the related code here:
https://github.com/odoo/odoo/blob/a32626be4cfbaeb21ed64a0abaad298e8e223ea3/addons/mail/static/src/core/common/message.xml#L146-L160
TODO: This code should be removed once the issue is fixed in the Odoo core.
https://github.com/odoo/odoo/pull/194643
-->
<xpath expr="//DropdownItem//i" position="before">
<t
t-if="action.callComponent"
t-component="action.callComponent"
t-props="action.props"
/>
<t t-else="">
<!-- used to move the elements into the t-else -->
<span class="mail_action_item d-none" />
</t>
</xpath>
<xpath expr="//span[hasclass('mail_action_item')]" position="before">
<xpath expr="//DropdownItem/i" position="move" />
<xpath expr="//DropdownItem/t[@t-esc='action.title']" position="move" />
</xpath>
</t>
</templates>

0 comments on commit ea11305

Please sign in to comment.