From 7270f879149aabefdec11e5d38380ff5666642de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Alan=20Ramos=20Rodr=C3=ADguez?= Date: Mon, 5 May 2025 09:45:35 -0600 Subject: [PATCH 1/2] [FIX] purchase_request: Fix allocation of purchase request lines This commit allow to post message in purchase requests when the purchase order is in done state. Odoo allow to confirm a purchase order in done state automatically, the message is not posted in the purchase request when the purchase order is in done state. --- purchase_request/models/purchase_request_allocation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_request/models/purchase_request_allocation.py b/purchase_request/models/purchase_request_allocation.py index 89080c4c674..4b4a3c9b782 100644 --- a/purchase_request/models/purchase_request_allocation.py +++ b/purchase_request/models/purchase_request_allocation.py @@ -85,7 +85,7 @@ class PurchaseRequestAllocation(models.Model): ) def _compute_open_product_qty(self): for rec in self: - if rec.purchase_state in ["cancel", "done"]: + if rec.purchase_state == "cancel": rec.open_product_qty = 0.0 else: rec.open_product_qty = ( From 593ca209f196d2b11df72fc42a7b1034c7c64d37 Mon Sep 17 00:00:00 2001 From: Hector Meraz Chavez Date: Wed, 9 Sep 2026 13:09:38 -0600 Subject: [PATCH 2/2] [FIX] purchase_request: post the receipt message on the picking as an internal note Co-Authored-By: Claude Opus 5 --- purchase_request/models/stock_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_request/models/stock_move_line.py b/purchase_request/models/stock_move_line.py index 33f4153e30d..7e4a4e7f4ad 100644 --- a/purchase_request/models/stock_move_line.py +++ b/purchase_request/models/stock_move_line.py @@ -121,7 +121,7 @@ def allocate(self): if picking_message: ml.move_id.picking_id.message_post( body=Markup(picking_message), - subtype_id=self.env.ref("mail.mt_comment").id, + subtype_id=self.env.ref("mail.mt_note").id, ) allocation._compute_open_product_qty()