Skip to content

[18.0][FIX] mail_brand: Brand not pre-filled in email compose wizard#307

Open
BhaveshHeliconia wants to merge 1 commit into
OCA:18.0from
HeliconiaIO:18.0-fix-mail_brand
Open

[18.0][FIX] mail_brand: Brand not pre-filled in email compose wizard#307
BhaveshHeliconia wants to merge 1 commit into
OCA:18.0from
HeliconiaIO:18.0-fix-mail_brand

Conversation

@BhaveshHeliconia
Copy link
Copy Markdown
Contributor

  • When opening the "Send Email" composer from a record that has a brand set, the Brand field was not being pre-populated.

  • The root cause is an API change in mail.compose.message: the res_id integer field was removed and replaced by res_ids, a Text field storing the record IDs as a JSON list. The old code was reading result.get("res_id") which is always None, so the auto-populate logic never ran.

  • The fix reads res_ids instead and uses odoo's own parse_res_ids helper to extract the active record ID.

  • The stale else branch that set result["brand_id"] = self.brand_id was also removed — in an @api.model method self carries no record, so this always evaluated to False and was silently overwriting any default_brand_id value passed in context.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @bosd, @switch87,
some modules you are maintaining are being modified, check this out!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants