From 3d59c5f249c8c88606c324dbb05acceb8ced55b8 Mon Sep 17 00:00:00 2001 From: Matteo Boscolo Date: Tue, 15 Oct 2024 09:26:22 +0200 Subject: [PATCH] FIX: problem on workflow --- plm/__manifest__.py | 2 +- plm/models/plm_mixin.py | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/plm/__manifest__.py b/plm/__manifest__.py index 33216316..f0f073b6 100644 --- a/plm/__manifest__.py +++ b/plm/__manifest__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "Product Lifecycle Management", - "version": "16.0.30", + "version": "16.0.31", "author": "OmniaSolutions", "website": "https://odooplm.omniasolutions.website", "category": "Manufacturing/Product Lifecycle Management (PLM)", diff --git a/plm/models/plm_mixin.py b/plm/models/plm_mixin.py index 0ded6173..1cea5c2a 100644 --- a/plm/models/plm_mixin.py +++ b/plm/models/plm_mixin.py @@ -460,6 +460,16 @@ def get_all_translation(self, object_id, fields): propKey = f"{field_name}@-@-@{code}" out[propKey] = getattr(obj.with_context(lang=code), field_name) return out - - - \ No newline at end of file + + @api.model + def get_possible_status(self): + out=[] + for model_id in self.env['ir.model'].sudo().search([('model','=', self._name)]): + for filed_id in self.env['ir.model.fields'].sudo().search([('model_id','=', model_id.id), + ('name', '=', 'engineering_state')]): + for ir_model_fields_selection in self.env['ir.model.fields.selection'].sudo().search([('field_id','=',filed_id.id)]): + out.append((ir_model_fields_selection.name, + ir_model_fields_selection.value)) + return out + + \ No newline at end of file