Skip to content

[18.0][FIX] ddmrp: fix _calc_incoming_dld_qty and _calc_qualified_demand#567

Open
gurneyalex wants to merge 1 commit intoOCA:18.0from
camptocamp:18.0-fix-moves_counted_twice
Open

[18.0][FIX] ddmrp: fix _calc_incoming_dld_qty and _calc_qualified_demand#567
gurneyalex wants to merge 1 commit intoOCA:18.0from
camptocamp:18.0-fix-moves_counted_twice

Conversation

@gurneyalex
Copy link
Member

In #535 a fix was introduced to take info account moves which have the stock.buffer's location in their final destination. This introduced a bug when different chained moves are moving a product towards its buffer location, as all the moves will be counted, resulting in a wrong net flow position (among others).

I propose to fix this with the following check: if a move with the final destination under the buffer's location has a matching final destination, and there are pending chained moves with the same final destination, these moves will be in our list: the current move needs to be disregarded.

We may still have a problem if the there are some cancelled moves and the total quantity does not match the original expected quantity, but this should be rare, so I'm not considering this in the current PR.

In OCA#535 a fix was introduced to take
info account moves which have the stock.buffer's location in their final
destination. This introduced a bug when different chained moves are
moving a product towards its buffer location, as all the moves will be
counted, resulting in a wrong net flow position (among others).

I propose to fix this with the following check: if a move with the final
destination under the buffer's location has a matching
final destination, and there are pending chained moves with
the same final destination, these moves will be in our list:
the current move needs to be disregarded.

We may still have a problem if the there are some cancelled
moves and the total quantity does not match the original expected
quantity, but this should be rare, so I'm not considering this in the
current PR.
@OCA-git-bot
Copy link
Contributor

Hi @LoisRForgeFlow, @JordiBForgeFlow,
some modules you are maintaining are being modified, check this out!

@LoisRForgeFlow
Copy link
Contributor

@gurneyalex It makes sense but I have a doubt: how do you get the final location that way in a route without push rules?

For instance, in an interwarehouse in which the 2 transfers are pre-created the final location of the first step is not WH2/Stock, it is the transit one.

image

Just wondering to understand the full context.

Also, if possible, I would like a test covering the case.

@LoisRForgeFlow LoisRForgeFlow changed the title [FIX] ddmrp: fix _calc_incoming_dld_qty and _calc_qualified_demand [18.0][FIX] ddmrp: fix _calc_incoming_dld_qty and _calc_qualified_demand Oct 24, 2025
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

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

waiting feedback to my comment #567 (comment)

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants