[19.0][MIG] partner_supplier_ref_sequence#2289
Open
JasminSForgeFlow wants to merge 7 commits intoOCA:19.0from
Open
[19.0][MIG] partner_supplier_ref_sequence#2289JasminSForgeFlow wants to merge 7 commits intoOCA:19.0from
JasminSForgeFlow wants to merge 7 commits intoOCA:19.0from
Conversation
MarinaAForgeFlow
approved these changes
Feb 18, 2026
Contributor
MarinaAForgeFlow
left a comment
There was a problem hiding this comment.
Code review, LGTM
|
When I duplicate it, the copy is set as if it weren’t a supplier, but it still has a supplier reference. Is this the expected behaviour? |
Contributor
I don't think this should be considered expected behavior. If the is_supplier is not copied, then the supplier reference sequence should not be set either. I will review the code and propose a fix in this migration, that can be back-ported to other versions. |
Currently translated at 100.0% (4 of 4 strings) Translation: partner-contact-18.0/partner-contact-18.0-partner_supplier_ref_sequence Translate-URL: https://translation.odoo-community.org/projects/partner-contact-18-0/partner-contact-18-0-partner_supplier_ref_sequence/it/
5c74479 to
af648cc
Compare
The field is_supplier is not copied, therefore any supplier copied should not have, at first, any suppler reference. However the observed behaviour was the opposite, the supplier was being copied with is_supplier=False and with supplier_ref. The issue is that the is_supplier is not in the vals_to_check when calling _needs_supplier_ref from the copy so the current partner, the one being copied and self, value was used to see if the sequence was needed. This is an error, we can not use the self value if this value is not the one that is being set on the copied partner. To solve this we have first removed the copy inherit, as it is indeed not relevant. The copy will later trigger the create, and in the vals we will have already what we need. Then, in the create inherit we call _needs_supplier_ref with an empty self, as we don't want to use the values of any possible self already set. That only makes sense on the write.
af648cc to
212961f
Compare
luisDIXMIT
approved these changes
Mar 3, 2026
luisDIXMIT
left a comment
There was a problem hiding this comment.
Code review and tested on runboat, LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standard Migration
@ForgeFlow