-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Conversation
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
@rousseldenis @xavier-bouquiaux Can you review and merge please 🙏 |
@@ -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 = [ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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.
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. |
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.