[18.0][MIG] mail_layout_force: Migration to 18.0#160
[18.0][MIG] mail_layout_force: Migration to 18.0#160AungKoKoLin1997 wants to merge 18 commits intoOCA:18.0from
Conversation
Currently translated at 100.0% (5 of 5 strings) Translation: social-16.0/social-16.0-mail_layout_force Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_layout_force/it/
This commit improves the process of replacing the layout when sending an email without selecting an email template.
01f6584 to
83d7ca6
Compare
9af0be1 to
0b3ccbf
Compare
nobuQuartile
left a comment
There was a problem hiding this comment.
Functional review:
In v15 of this module, when sending an email from the Send Mail button in a form view, it was sufficient to set "No Layout" on the corresponding email template's Force Layout field to remove the email header and footer.
However, in v18 this does not seem to work anymore. Instead, it appears necessary to configure the layout per model using the Layout Mapping feature described in the README:
“To force a custom layout for emails that do not use an existing email.template record (e.g., emails sent from the chatter), you can use the Layout Mapping feature.”
Is this the expected behavior in v18?
0b3ccbf to
86853e0
Compare
Override default_get to ensure template's email_layout_xmlid takes priority over context defaults when mail composer is initialized. The compute method is not triggered at initialization when a default value exists, so we need to explicitly override it in default_get. Also clarify in documentation when to use Layout Mapping for direct message_post calls (e.g., invoice send actions).
|
I added a fix commit to handle not prioritizing when there is default_email_layout_xmlid and improve the readme a bit. |
| record (e.g., emails sent from the chatter) or for cases where emails are sent | ||
| directly via `message_post` without opening the mail composer (e.g., invoice send | ||
| actions like `action_invoice_sent`), you can use the Layout Mapping feature: |
There was a problem hiding this comment.
Could we extend message_post() to prioritize the forced layout when template is available? This config advice is not admin friendly as you wouldn't know how layout is hard-coded unless you read the code.
@qrtl QT6177