Skip to content

Conversation

nicolas-delbovier-acsone
Copy link

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Jun 30, 2025

Make sure the replenishment method always returns its ongoing replenishment moves.

This is useful in case we want to add custom logic to the generated/updated replenishment moves. If the moves get returned, we do not need to make a second query to gather them afterwards.

This PR is based on #54

@OCA-git-bot
Copy link
Contributor

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

@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the stock-location-orderpoint-return-assigned-replenishment-moves branch from 6b0193b to 5244aff Compare June 30, 2025 14:28
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [IMP] stock_location_orderpoint: returns the assigned replenishment moves. [16.0][IMP] stock_location_orderpoint: returns the assigned replenishment moves. Jun 30, 2025
@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the stock-location-orderpoint-return-assigned-replenishment-moves branch 2 times, most recently from b6af5b1 to 6328ebb Compare July 4, 2025 11:54
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [16.0][IMP] stock_location_orderpoint: returns the assigned replenishment moves. [16.0][IMP] stock_location_orderpoint: returns the generated replenishment moves. Jul 23, 2025
@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the stock-location-orderpoint-return-assigned-replenishment-moves branch from 6328ebb to f712e4b Compare July 31, 2025 09:39
@nicolas-delbovier-acsone
Copy link
Author

I forced push to rebase to #54

@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [16.0][IMP] stock_location_orderpoint: returns the generated replenishment moves. [16.0][IMP] stock_location_orderpoint: returns the outgoing replenishment moves. Jul 31, 2025
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [16.0][IMP] stock_location_orderpoint: returns the outgoing replenishment moves. [16.0][IMP] stock_location_orderpoint: returns the ongoing replenishment moves. Jul 31, 2025
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.

Thanks for your contribution, this is a good idea.

self.env["procurement.group"].with_context(from_orderpoint=True).run(
procurements, raise_user_error=False
)
return self._after_replenishment()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather move the logic for getting the current replenishment moves into here and then passing them on downwards, instead of getting them from the result of _after_replenishment.

Suggested change
return self._after_replenishment()
replenishment_moves = self._get_current_replenishment_moves()
self._after_replenishment(replenishment_moves)
return replenishment_moves

Choose a reason for hiding this comment

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

You are right, this is probably better to put this logic there, I'll make a commit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants