Skip to content

[16.0][IMP] stock_release_channel_partner_by_date: do not archive future partner dates on action_sleep#1190

Open
santostelmo wants to merge 1 commit into
OCA:16.0from
camptocamp:16.0-imp-stock_release_channel_partner_by_date
Open

[16.0][IMP] stock_release_channel_partner_by_date: do not archive future partner dates on action_sleep#1190
santostelmo wants to merge 1 commit into
OCA:16.0from
camptocamp:16.0-imp-stock_release_channel_partner_by_date

Conversation

@santostelmo

Copy link
Copy Markdown
Contributor

When putting a release channel to sleep, restrict the deactivation of channel partner dates to only those in the past or present (<= today), leaving future configurations active.

  • Update action_sleep() in the release channel model to construct an AND domain filtering by date.
  • Add test_release_channel_sleep_archive_specific_date_future to ensure future dates are untouched.

…rtner dates on action_sleep

When putting a release channel to sleep, restrict the deactivation of channel partner
dates to only those in the past or present (<= today), leaving future configurations active.

- Update action_sleep() in the release channel model to construct an AND domain filtering by date.
- Add test_release_channel_sleep_archive_specific_date_future to ensure future dates are untouched.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sebalix, @jbaudoux,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:16.0 mod:stock_release_channel_partner_by_date Module stock_release_channel_partner_by_date labels Jun 19, 2026
domain = expression.AND(
[
self._get_release_channel_partner_date_domain(),
[("date", "<=", fields.Date.today())],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Couldn't this be moved into _get_release_channel_partner_date_domain?

I'm not sure to what extent this should be configurable at the stock.release.channel level in order to avoid breaking the module's behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered that, but _get_release_channel_partner_date_domain() is a generic selector for partner-date records related to the channel.
Adding ("date", "<=", today) there would make the date cutoff part of the base domain everywhere , which would change module behavior outside action_sleep().
In this PR I only want to limit the archival behavior during action_sleep(), so I kept the extra condition local to that method.

domain = expression.AND(
[
self._get_release_channel_partner_date_domain(),
[("date", "<=", fields.Date.today())],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The date is the delivery date. So you should add this only if there is a shipment_date and use that date instead of today. You can add a dependency on stock_release_channel_shipment_lead_time for that as there is no base delivery date concept on the stock release channel base module.

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

Labels

mod:stock_release_channel_partner_by_date Module stock_release_channel_partner_by_date series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants