Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 22, 2025

Description of the issue/feature this PR addresses:

When a product is configured with both buy and manufacture routes, the manufacture route is always prioritized, regardless of the sequence defined in the routes.

Current behavior before PR:

The method extract_rule stops evaluating routes once it finds a valid rule, even if other rules with a lower sequence exist. This leads to the manufacture route being prioritized over buy, which is not the intended behavior.

Desired behavior after PR is merged:

The routes are now evaluated based on their sequence, ensuring that rules associated with routes of lower sequence are considered first.


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
cc @ForgeFlow

Forward-Port-Of: #188846

@robodoo
Copy link
Contributor

robodoo commented Jan 22, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 22, 2025

@RicardCForgeFlow @Whenrow cherrypicking of pull request #188846 failed.

stdout:

Auto-merging doc/cla/corporate/forgeflow.md
CONFLICT (content): Merge conflict in doc/cla/corporate/forgeflow.md

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Jan 22, 2025
@C3POdoo C3POdoo added the RD research & development, internal work label Jan 22, 2025
Sort route_ids by sequence within the 'extract_rule' method to ensure rules
associated with lower-sequence routes are evaluated first. This resolves
issues where higher-sequence routes (e.g., 'manufacture') were selected
before lower-sequence routes (e.g., 'buy').

Added a test to ensure _get_rule selects routes based on their sequence,
prioritizing lower-sequence routes. This validates that routes are
correctly ordered even when assigned in an unsorted manner.
@Whenrow Whenrow force-pushed the saas-17.2-17.0-stock-rule_prioritize_routes_by_sequence-WLpF-fw branch from 5c6ff69 to 2b705bc Compare January 23, 2025 13:30
@Whenrow
Copy link
Contributor

Whenrow commented Jan 23, 2025

robodoo r+ rebase-ff

@robodoo
Copy link
Contributor

robodoo commented Jan 23, 2025

Merge method set to rebase and fast-forward.

@C3POdoo C3POdoo requested a review from a team January 23, 2025 13:33
robodoo pushed a commit that referenced this pull request Jan 23, 2025
Sort route_ids by sequence within the 'extract_rule' method to ensure rules
associated with lower-sequence routes are evaluated first. This resolves
issues where higher-sequence routes (e.g., 'manufacture') were selected
before lower-sequence routes (e.g., 'buy').

Added a test to ensure _get_rule selects routes based on their sequence,
prioritizing lower-sequence routes. This validates that routes are
correctly ordered even when assigned in an unsorted manner.

Part-of: #194706
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
robodoo pushed a commit that referenced this pull request Jan 23, 2025
closes #194706

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
@robodoo robodoo closed this Jan 23, 2025
@fw-bot fw-bot deleted the saas-17.2-17.0-stock-rule_prioritize_routes_by_sequence-WLpF-fw branch February 6, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants