Skip to content

[16.0][IMP] stock_release_channel_partner_by_date: enforce specific channel partner date #998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

santostelmo
Copy link
Contributor

No description provided.

@OCA-git-bot
Copy link
Contributor

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

@santostelmo santostelmo changed the title [IMP] stock_release_channel_partner_by_date: enforce specific channel partner date [16.0][IMP] stock_release_channel_partner_by_date: enforce specific channel partner date Mar 25, 2025
@santostelmo santostelmo force-pushed the 16.0-imp-stock_release_channel_partner_by_date-enforce_specific_channel_partner_date branch 4 times, most recently from 17620a5 to 359a2d9 Compare March 26, 2025 06:54
@santostelmo santostelmo force-pushed the 16.0-imp-stock_release_channel_partner_by_date-enforce_specific_channel_partner_date branch from 359a2d9 to 91112b4 Compare March 26, 2025 09:46
def _find_release_channel_possible_candidate(self):
channels = super()._find_release_channel_possible_candidate()
specific_channel = self.env["stock.release.channel.partner.date"].search(
self._get_release_channel_partner_date_domain()
Copy link
Contributor

Choose a reason for hiding this comment

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

You are doing the same as the method above except that you don't respect the company and warehouse. It is not the right approach

Copy link
Contributor

Choose a reason for hiding this comment

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

Here is a proposal #999

I kept your test but added the warehouse as you changed the picking type so that it properly detects it's an exception valid for the picking's warehouse

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the carrier must also be valid is you have stock_release_channel_delivery. That's why we use _get_release_channel_possible_candidate_domain_picking() and not only _get_release_channel_partner_date_domain()

Comment on lines -45 to +47
# Then delivery gets the default channel
# Then delivery does not fallback in any other channel
self.env["stock.release.channel"].assign_release_channel(picking_out)
self.assertEqual(picking_out.release_channel_id, self.default_channel)
self.assertFalse(picking_out.release_channel_id)
Copy link
Contributor

@jbaudoux jbaudoux Mar 27, 2025

Choose a reason for hiding this comment

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

This is a change of behavior.
If we set an exception, it is only valid for a defined carrier.
We shouldn't change that.

We should prevent to have an specific channel on the SO that is not in line with the SO carrier.

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.

4 participants