Skip to content

Commit 83cc3ec

Browse files
[FIX]purchase_manual_delivery: uom fixes
Fixed issues when uom_id and uom_po_id of a product are different. - Comparison for Purchase Order Line pending to receive now uses the product quantity that uses the uom of the Purchase Order Line. - When creating the Stock Move the quantity is now computed into the uom of the Stock Move
1 parent 6ec356a commit 83cc3ec

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

purchase_manual_delivery/models/purchase_order.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _compute_existing_qty(self):
9393
)
9494
line.existing_qty = total
9595
if float_compare(
96-
line.product_uom_qty,
96+
line.product_qty,
9797
line.existing_qty,
9898
precision_digits=precision_digits,
9999
):

purchase_manual_delivery/wizard/create_manual_stock_picking.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,13 @@ def _create_stock_moves(self, picking):
236236
for val in line._prepare_stock_moves(picking):
237237
if val.get("product_uom_qty", False):
238238
# CHECK ME: We can receive more than one move
239+
product_uom = (
240+
self.env["uom.uom"].browse(val.get("product_uom", 0))
241+
or line.product_uom
242+
)
239243
val["product_uom_qty"] = line.product_uom._compute_quantity(
240244
line.qty,
241-
line.product_uom,
245+
product_uom,
242246
rounding_method="HALF-UP",
243247
)
244248
if (

0 commit comments

Comments
 (0)