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
Instead of checking identical packaging code, odoo checks packaging #24301
Conversation
When we create shipment for FedEx carrier with 2 packages of different sizes, it raises a warning message as "You are shipping different packaging types in the same shipment". Instead of checking identical packaging code, odoo checks packaging.
@@ -200,7 +200,7 @@ def check_packages_are_identical(self): | |||
self.ensure_one() | |||
if self.package_ids: | |||
packages = [p.packaging_id for p in self.package_ids] | |||
if len(set(packages)) != 1: | |||
if len(set([package.shipper_package_code for package in packages])) != 1: |
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.
can be also expressed packages.mapped('shipper_package_code')
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.
"packages.mapped('shipper_package_code')"
Here packages is a 'list' object.We can't use 'mapped'.
@mge-odoo Can you enlighten us on this? (since you are the author of this check, you should know what was exactly expected) |
@rim-odoo could you have a look here? I have the feeling that the docstring ('Some shippers require identical packages in the same shipment.') forbids the use case reported here ('You are shipping different packaging types in the same shipment'). Thanks |
@nim-odoo Corner case here: we thought about checking that people used always the same packaging type (same id) instead of checking that they use the same packaging code... but I'm not sure FedEx allows to send packages with the same code but different sizes. |
After internal discussion, we might probably for a more extreme solution: remove the check completely (see #23797). The check is only for convenience, but if it causes more troubles than it solves, we can remove it. |
Description of the issue/feature this PR addresses:
When we create shipment for FedEx carrier with 2 packages of different sizes, it raises a warning message as "You are shipping different packaging types in the same shipment". Instead of checking identical packaging code, odoo checks packaging.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr