From f3a9d626444d226af5296dc9135cae6d02f167a9 Mon Sep 17 00:00:00 2001 From: Tom Blauwendraat Date: Fri, 28 Jun 2024 10:37:29 +0200 Subject: [PATCH] [FIX] don't traceback when origin is not filled In some cases, orderpoint_id is filled but origin is not. I have no idea which exact flows lead to this, but I notice it is fixed in future Odoo versions as part of odoo/odoo/pull/80319. I'm not sure about backporting all of that, but at least this part is IMO harmless to just merge in. --- addons/mrp/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 4e9779ef4c28f..f102f7e1895ca 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -964,7 +964,7 @@ def _get_moves_raw_values(self): def _get_move_raw_values(self, product_id, product_uom_qty, product_uom, operation_id=False, bom_line=False): source_location = self.location_src_id origin = self.name - if self.orderpoint_id: + if self.orderpoint_id and self.origin: origin = self.origin.replace( '%s - ' % (self.orderpoint_id.display_name), '') origin = '%s,%s' % (origin, self.name)