From e6afb8e69bfa19233d2ac241c41623935df81c50 Mon Sep 17 00:00:00 2001 From: Matteo Boscolo Date: Tue, 15 Oct 2024 09:47:49 +0200 Subject: [PATCH] FIX: problem on workflow --- plm/models/plm_mixin.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plm/models/plm_mixin.py b/plm/models/plm_mixin.py index 0ded6173..7b1190eb 100644 --- a/plm/models/plm_mixin.py +++ b/plm/models/plm_mixin.py @@ -461,5 +461,14 @@ def get_all_translation(self, object_id, fields): out[propKey] = getattr(obj.with_context(lang=code), field_name) return out - + @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