From 2490982fce22ce5af3ff77685dac06f0f1223505 Mon Sep 17 00:00:00 2001 From: Krzysztof Magusiak Date: Tue, 10 May 2022 13:51:09 +0000 Subject: [PATCH] [FIX] sale_project: Expecting an ID in write for Many2One When we are writing on a Many2One field, we are supposed to pass the id of the object, in this case we are passing directly the object which is working with the ORM, but is not expected in overrides as the documentation suppose that an int is passed. community PR refused in stable:https://github.com/odoo/odoo/pull/88736 closes odoo/odoo#90992 Signed-off-by: Laurent Stukkens (ltu) --- addons/sale_project/models/sale_order_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_project/models/sale_order_line.py b/addons/sale_project/models/sale_order_line.py index 8043255c354..74b3f9850ff 100644 --- a/addons/sale_project/models/sale_order_line.py +++ b/addons/sale_project/models/sale_order_line.py @@ -169,7 +169,7 @@ class SaleOrderLine(models.Model): # duplicating a project doesn't set the SO on sub-tasks project.tasks.filtered('parent_id').write({ 'sale_line_id': self.id, - 'sale_order_id': self.order_id, + 'sale_order_id': self.order_id.id, }) else: project_only_sol_count = self.env['sale.order.line'].search_count([