Skip to content
Snippets Groups Projects
Commit 4f5cfbd9 authored by kir-odoo's avatar kir-odoo
Browse files

[FIX] delivery: exclude neg qtys from shipping weight


This commit prevents inclusion of negative qty SO products from
the calculation of its estimated shipping weight. Negative qtys can
indicate a return, which would be a separate picking from the delivery
 => we shouldn't subtract their weight from the delivery. This
subtraction, may have resulted in shipping rates being calculated as
lower than they should have been within the SO.

Additionally fixes the following use case (requires Fedex connector):
- create a SO with 2 products with the same weight
- set 1st product qty = 1
- set 2nd product qty = -1
- add shipping => Shipping Method = Fedex US
- click on "Get Rate"

An error will occur because the SO._get_estimated_weight() = 0, and
you cannot have a rate for weight = 0

TaskId - 3028023

closes odoo/odoo#104658

Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
parent b1be3262
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment