Skip to content

[19.0][MIG] partner_supplier_ref_sequence#2289

Open
JasminSForgeFlow wants to merge 7 commits intoOCA:19.0from
ForgeFlow:19.0-mig-partner_supplier_ref_sequence
Open

[19.0][MIG] partner_supplier_ref_sequence#2289
JasminSForgeFlow wants to merge 7 commits intoOCA:19.0from
ForgeFlow:19.0-mig-partner_supplier_ref_sequence

Conversation

@JasminSForgeFlow
Copy link

Standard Migration

@ForgeFlow

Copy link
Contributor

@MarinaAForgeFlow MarinaAForgeFlow left a comment

Choose a reason for hiding this comment

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

Code review, LGTM

Copy link

@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

@luisDIXMIT
Copy link

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?

@MarinaAForgeFlow
Copy link
Contributor

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 behavior?

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.

@MarinaAForgeFlow MarinaAForgeFlow force-pushed the 19.0-mig-partner_supplier_ref_sequence branch from 5c74479 to af648cc Compare March 2, 2026 16:54
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.
@MarinaAForgeFlow MarinaAForgeFlow force-pushed the 19.0-mig-partner_supplier_ref_sequence branch from af648cc to 212961f Compare March 2, 2026 17:01
Copy link

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

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

Code review and tested on runboat, LGTM!

Copy link
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.

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.

7 participants