From 5f7030fc446c30f7996b32c9ffed006882a31d42 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 22 Aug 2017 14:37:50 +0200 Subject: [PATCH] [FIX] stock: move name length - Create a stockable product with a long description (> 3000 characters) - Validate the SO An error is raised because the stock move name is too long. The stock move name is taken from the procurement name, which is itself taken from the SO line description. However, the stock move name is an indexed field and therefore its length is limited (to 2712 characters by default). We truncate the move name to 2000 characters. Actually, there is no real point to so many characters, nor its indexing. opw-767040 --- addons/stock/models/procurement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py index c1ea59f239a..4d3e78aa75c 100644 --- a/addons/stock/models/procurement.py +++ b/addons/stock/models/procurement.py @@ -151,7 +151,7 @@ class ProcurementOrder(models.Model): qty_done = sum(self.move_ids.filtered(lambda move: move.state == 'done').mapped('product_uom_qty')) qty_left = max(self.product_qty - qty_done, 0) return { - 'name': self.name, + 'name': self.name[:2000], 'company_id': self.rule_id.company_id.id or self.rule_id.location_src_id.company_id.id or self.rule_id.location_id.company_id.id or self.company_id.id, 'product_id': self.product_id.id, 'product_uom': self.product_uom.id,