Skip to content

[18.0][MIG] mail_layout_force: Migration to 18.0#160

Open
AungKoKoLin1997 wants to merge 18 commits intoOCA:18.0from
qrtl:18.0-mig-mail_layout_force
Open

[18.0][MIG] mail_layout_force: Migration to 18.0#160
AungKoKoLin1997 wants to merge 18 commits intoOCA:18.0from
qrtl:18.0-mig-mail_layout_force

Conversation

@AungKoKoLin1997
Copy link
Contributor

@qrtl QT6177

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 18.0-mig-mail_layout_force branch from 01f6584 to 83d7ca6 Compare March 11, 2026 02:10
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 18.0-mig-mail_layout_force branch 6 times, most recently from 9af0be1 to 0b3ccbf Compare March 12, 2026 02:09
Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

Copy link
Contributor

@nobuQuartile nobuQuartile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 18.0-mig-mail_layout_force branch from 0b3ccbf to 86853e0 Compare March 12, 2026 04:45
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).
@AungKoKoLin1997
Copy link
Contributor Author

I added a fix commit to handle not prioritizing when there is default_email_layout_xmlid and improve the readme a bit.
7d5ea44

Comment on lines +20 to +22
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants