Skip to content

[19.0][ADD] partner_display_ref - #2384

Open
JasminSForgeFlow wants to merge 1 commit into
OCA:19.0from
ForgeFlow:19.0-add-partner_display_ref
Open

[19.0][ADD] partner_display_ref#2384
JasminSForgeFlow wants to merge 1 commit into
OCA:19.0from
ForgeFlow:19.0-add-partner_display_ref

Conversation

@JasminSForgeFlow

Copy link
Copy Markdown

This module prefixes the customer reference (res.partner.ref) to a partner's
display_name whenever it is rendered inside an opted-in view — typically as
[C00123] Acme Corp in an autocomplete dropdown.

The decoration is a generic mechanism: it activates only when a view injects
the partner_display_ref_field context key naming the field to prefix on a
res.partner field. Contacts, CRM,
Invoicing and any other view that does not opt in continue to see the plain
partner name. Companion modules (e.g. sale_partner_display_ref) wire this
mechanism into specific apps.

@ForgeFlow

@ChristianSantamaria ChristianSantamaria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only review code LGTM 👍

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@JasminSForgeFlow
JasminSForgeFlow force-pushed the 19.0-add-partner_display_ref branch from 7dea9cc to be56841 Compare June 10, 2026 04:57
def _compute_display_name(self):
super()._compute_display_name()
ctx = self.env.context
field_name = ctx.get("partner_display_ref_field")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe a little explanation on why computing the value on context value in this case ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

For now, this case OCA/purchase-workflow#3094

and for the same kind of case where the field name is different, to handle it with any particular app

@luisDIXMIT luisDIXMIT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review and tested locally, LGTM!

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.

6 participants