Skip to content
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

[16.0][IMP] stock_reserve default_picking_type #1900

Closed
wants to merge 1 commit into from

Conversation

acsonefho
Copy link

Better to search for the default picking_type_id instead of using an XML id. Because the XML ID could not exist anymore and/or be related to another company.

Better to search for the default picking_type_id instead of using an XML id. Because the XML ID could not exist anymore and/or be related to another company
@acsonefho
Copy link
Author

@rousseldenis @xavier-bouquiaux Can you review and merge please 🙏

@rafaelbn rafaelbn added this to the 16.0 milestone Dec 2, 2023
@rafaelbn rafaelbn requested a review from rousseldenis December 2, 2023 01:49
@@ -108,8 +108,13 @@ def get_location_from_ref(self, ref):

@api.model
def _default_picking_type_id(self):
ref = "stock.picking_type_out"
return self.env.ref(ref, raise_if_not_found=False).id
domain = [
Copy link
Contributor

Choose a reason for hiding this comment

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

@acsonefho I would have changed to the company default warehouse 'out_type_id' field.

Copy link
Author

Choose a reason for hiding this comment

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

I agree but in case of multi-warehouse for a same company?

Copy link
Member

Choose a reason for hiding this comment

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

There is an implicit order on sequence, id in the search for stock.picking.type, so you can control which one gets selected by default. I'm fine with this.

The alternative is to rely on the warehouse sequence for a given company, this is also fine.

Whatever the choice, I would document it in the README.

@@ -108,8 +108,13 @@ def get_location_from_ref(self, ref):

@api.model
def _default_picking_type_id(self):
ref = "stock.picking_type_out"
return self.env.ref(ref, raise_if_not_found=False).id
domain = [
Copy link
Member

Choose a reason for hiding this comment

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

There is an implicit order on sequence, id in the search for stock.picking.type, so you can control which one gets selected by default. I'm fine with this.

The alternative is to rely on the warehouse sequence for a given company, this is also fine.

Whatever the choice, I would document it in the README.

Copy link

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 Jun 16, 2024
@github-actions github-actions bot closed this Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review 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