Skip to content

[19.0][ADD] sale_partner_display_ref#4369

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

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

Conversation

@JasminSForgeFlow
Copy link
Copy Markdown
Contributor

@JasminSForgeFlow JasminSForgeFlow commented May 26, 2026

This module prefixes the customer reference (res.partner.ref) to the
partner's display_name whenever it is rendered inside a Sales view —
typically as [C00123] Acme Corp in the autocomplete dropdown of the
customer field on a sales quotation or order.

The decoration mechanism lives in the generic partner_display_ref module;
this module only injects the partner_display_ref_field context key (set to
ref) into the Sales views. Contacts, CRM, Invoicing and any other module that reads
display_name continues to see the plain partner name.

Depends on:

@ForgeFlow

@OCA-git-bot OCA-git-bot added series:19.0 mod:sale_partner_display_ref Module sale_partner_display_ref labels May 26, 2026
Copy link
Copy Markdown
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Code LGTM. Perhaps you can consolidate tests into 1-2 tests. Having so many tests for so little code is too much I think.

Copy link
Copy Markdown

@ChristianSantamaria ChristianSantamaria left a comment

Choose a reason for hiding this comment

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

Hey, funtional and code review, 👍 👍

I think this is a good module for improving contact visibility, but I believe this add-on could be more generic. For example, the base module could be "partner_display_ref", and another, dependent module, "sale_partner_display_ref", would add the necessary context to the sales views. This would allow for future application to other modules.

What do you think?

Anyway see minor change..

Comment on lines +17 to +18
for partner in self:
if partner.ref:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
for partner in self:
if partner.ref:
for partner in self.filtered(lambda x: x.ref):

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.

@ChristianSantamaria You can use directly the field like self.filtered("ref").

I was using filtered() like you suggested, BUT, filtered() do a loop on all records of the recordset. So, it is not advantageous in terms of performance. @JasminSForgeFlow You can let the code as is.

Copy link
Copy Markdown
Contributor

@BhaveshHeliconia BhaveshHeliconia 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 LGTM!

@JasminSForgeFlow JasminSForgeFlow force-pushed the 19.0-add-sale_partner_display_ref branch from 927bc4c to e052a36 Compare June 8, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants