Skip to content

Conversation

rousseldenis
Copy link
Contributor

No description provided.

@rousseldenis rousseldenis marked this pull request as ready for review June 3, 2024 12:11
@OCA-git-bot
Copy link
Contributor

Hi @mt-software-de,
some modules you are maintaining are being modified, check this out!

@rousseldenis rousseldenis added this to the 16.0 milestone Jun 3, 2024
Copy link

github-actions bot commented Oct 6, 2024

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 Oct 6, 2024
@github-actions github-actions bot closed this Nov 10, 2024
@rousseldenis rousseldenis reopened this Jun 27, 2025
@OCA-git-bot
Copy link
Contributor

Hi @mt-software-de,
some modules you are maintaining are being modified, check this out!

Copy link
Contributor

@mt-software-de mt-software-de left a comment

Choose a reason for hiding this comment

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

Thx for this change.
Why isn't that implemented in the base addon?
Why hasn't this been implemented in places where we know that the priority might change? For example on _merge_moves and on __prepare_procurements?

replenish_move_manual = self._get_replenishment_move(manual_orderpoint)

self.assertTrue(replenish_move_manual)
self.assertEqual(12.0, replenish_move_manual.product_uom_qty)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.assertEqual(12.0, replenish_move_manual.product_uom_qty)
self.assertEqual(12.0, replenish_move_manual.product_uom_qty)
self.assertEqual("0", replenish_move_manual.priority)

Comment on lines +15 to +16
domain = [
("location_dest_id", "child_of", self.location_id.id),
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have a self.ensure_one() check. Otherwise self.location_id.id could fail.

Suggested change
domain = [
("location_dest_id", "child_of", self.location_id.id),
self.ensure_one()
domain = [
("location_dest_id", "child_of", self.location_id.id),

Comment on lines 47 to 64
replenishment_moves_by_location = (
orderpoint._find_current_replenishment_moves_for_orderpoint_location(
products=products
)
)

for (
__location,
replenishment_moves,
) in replenishment_moves_by_location.items():
replenishment_moves_to_update |= replenishment_moves

if replenishment_moves_to_update:
replenishment_moves_to_update.write(
{
"priority": orderpoint.priority,
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is _find_current_replenishment_moves_for_orderpoint_location returning the moves grouped by location, when the location is never used? By not grouping it it would ease the code.

Suggested change
replenishment_moves_by_location = (
orderpoint._find_current_replenishment_moves_for_orderpoint_location(
products=products
)
)
for (
__location,
replenishment_moves,
) in replenishment_moves_by_location.items():
replenishment_moves_to_update |= replenishment_moves
if replenishment_moves_to_update:
replenishment_moves_to_update.write(
{
"priority": orderpoint.priority,
}
)
replenishment_moves = (
orderpoint._find_current_replenishment_moves_for_orderpoint_location(
products=products
)
)
if replenishment_moves:
replenishment_moves.write(
{
"priority": orderpoint.priority,
}
)

We consider the orderpoint has been triggered, so we need
"""
replenishment_moves_to_update = self.env["stock.move"].browse()
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be defined outside the loop. Otherwise i could write on moves which not belong to the orderpoint.

@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-imp-stock-location-orderpoint-priority-dro branch from a9ab73e to 55f5eca Compare June 27, 2025 12:31
The unit test `test_stock_location_orderpoint_priority_change` was failing
in `stock_location_orderpoint` because the associated logic was moved
to `stock_location_orderpoint_change_priority`.

This commit removes the now-obsolete test from `stock_location_orderpoint`
as an identical test already exists and passes within the
`stock_location_orderpoint_change_priority` module, where the relevant
priority change logic now resides.
@nicolas-delbovier-acsone

@mt-software-de Thanks for the review. I will come back later on this. I was jyst fixing this branch as I need it for our client.

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 29, 2025
…e in replenishment logic.

This commit delays the priority update to occur *after* moves have been merged. This ensures that the function merging replenishment moves still has access to the "not yet updated" priorities preventing information loss.
Some test was failing because the code saying "day +1" fails if we are the last day of a month.
@lmignon
Copy link
Contributor

lmignon commented Sep 25, 2025

@rousseldenis @nicolas-delbovier-acsone Can we close this one in favour of #55.

@nicolas-delbovier-acsone

@rousseldenis @nicolas-delbovier-acsone Can we close this one in favour of #55.

That's fine with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants