From d50e2b00104efcc2253511383aa817ee05aeaced Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Tue, 10 Dec 2019 16:52:14 +0000 Subject: [PATCH] [IMP] mrp: add sequence of work order in the display name In order to clarify the flow of work order in calendar and gantt view, add the sequence number of WO by MO. This sequence is compute during the call of the "name_get". task-2082261 --- addons/mrp/models/mrp_workorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index b1c692246b1..967840d4678 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -236,7 +236,7 @@ class MrpWorkorder(models.Model): (self - treated).allowed_lots_domain = False def name_get(self): - return [(wo.id, "%s - %s - %s" % (wo.production_id.name, wo.product_id.name, wo.name)) for wo in self] + return [(wo.id, "%s. %s - %s - %s" % (wo.production_id.workorder_ids.ids.index(wo.id) + 1, wo.production_id.name, wo.product_id.name, wo.name)) for wo in self] def unlink(self): # Removes references to workorder to avoid Validation Error