Files
odoo_source/addons/stock_delivery
Ahmad Khanalizadeh 861db8a5a7 [FIX] delivery: use correct unit price for commodities
Steps to reproduce:
Make a sale order with a product and quantity > 1, add
FedEx international shipping and validate the delivery
In the document you will see that the unit cost is equal
to subtotal which is wrong.

There is a discrepancy between `_get_commodities_from_order` and
`_get_commodities_from_stock_move_lines`, that the former makes
commodities with `monetary_value` equal to the unit price, while
the latter uses subtotal. in the method `commodities` in
`delivery_fedex`, `monetary_value` is treated as unit price, so
the right way to fix it is to do it in
`_get_commodities_from_stock_move_lines`.

Note that when rating a delivery, commodities are made in
`_get_commodities_from_order` and then passed to `commodities`,
while for sending the shipping, commodities are made in
`_get_commodities_from_stock_move_lines`.

opw-3233369

closes odoo/odoo#117521

X-original-commit: 3beddbdd18937e1c69ec4fa6f523296c7c55528b
Related: odoo/enterprise#39234
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
2023-04-03 22:55:48 +02:00
..
…
2023-03-16 18:32:59 +01:00