From 2219e0dd39c9d3fd3052b7cc65d8ba53e58ae315 Mon Sep 17 00:00:00 2001 From: Walid Date: Mon, 27 Nov 2023 19:41:46 +0100 Subject: [PATCH] [FIX] purchase_requisition: Create purchase order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce (V 17.0): - Create a new blanket order with agreement type "Call for bids": - Select only one RFQ - Use line of agreement - use quantities of agreement - Add a product and confirm - Create a New quotation - Traceback! Bug: typo in the onchange makes it so instead of setting payment_term_id to false it's a False, which is actually a tupple (False,) meaning payment terms will be a record set containg one value with Id False instead of an empty record set (it's wrong but it doesn't really make a difference in this case) until commit[1] in web_read clean up is used to get the Id from origin Id for inherited fields ´not vals['id']´ is expected to be true if the value has an origin Id but in this case it is true because Id is false (co_records wasn't expected to contains values with Id False if Id is False it should be empty) commit[1]:https://github.com/odoo/odoo/pull/128878 closes odoo/odoo#144111 X-original-commit: 7c5106a46bc269f2ed4cbeb18f2172b274dd27a5 Signed-off-by: Tiffany Chang (tic) Signed-off-by: Walid Hanniche (waha) --- addons/purchase_requisition/models/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase_requisition/models/purchase.py b/addons/purchase_requisition/models/purchase.py index 5e9686b79f9..64fc26c764c 100644 --- a/addons/purchase_requisition/models/purchase.py +++ b/addons/purchase_requisition/models/purchase.py @@ -59,7 +59,7 @@ class PurchaseOrder(models.Model): self.partner_id = partner.id self.fiscal_position_id = fpos.id - self.payment_term_id = payment_term.id, + self.payment_term_id = payment_term.id self.company_id = requisition.company_id.id self.currency_id = requisition.currency_id.id if not self.origin or requisition.name not in self.origin.split(', '):