[19.0][ADD] sale_partner_display_ref#4369
Conversation
AaronHForgeFlow
left a comment
There was a problem hiding this comment.
Code LGTM. Perhaps you can consolidate tests into 1-2 tests. Having so many tests for so little code is too much I think.
ChristianSantamaria
left a comment
There was a problem hiding this comment.
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..
| for partner in self: | ||
| if partner.ref: |
There was a problem hiding this comment.
| for partner in self: | |
| if partner.ref: | |
| for partner in self.filtered(lambda x: x.ref): |
There was a problem hiding this comment.
@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.
BhaveshHeliconia
left a comment
There was a problem hiding this comment.
Functional review LGTM!
927bc4c to
e052a36
Compare
This module prefixes the customer reference (
res.partner.ref) to thepartner's
display_namewhenever it is rendered inside a Sales view —typically as
[C00123] Acme Corpin the autocomplete dropdown of thecustomer field on a sales quotation or order.
The decoration mechanism lives in the generic
partner_display_refmodule;this module only injects the
partner_display_ref_fieldcontext key (set toref) into the Sales views. Contacts, CRM, Invoicing and any other module that readsdisplay_namecontinues to see the plain partner name.Depends on:
@ForgeFlow