From 34df4552e5ea61125c6f579390769f460f9ea573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 16 Nov 2024 18:43:16 +0100 Subject: [PATCH] Limit inbound email result to ModelStorage and ModelView --- modules/inbound_email/inbound_email.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/inbound_email/inbound_email.py b/modules/inbound_email/inbound_email.py index bfa8f5cb7e..75bc1115d5 100644 --- a/modules/inbound_email/inbound_email.py +++ b/modules/inbound_email/inbound_email.py @@ -12,7 +12,8 @@ from email.utils import getaddresses from functools import partial from trytond.config import config -from trytond.model import ModelSQL, ModelView, fields, sequence_ordered +from trytond.model import ( + ModelSQL, ModelStorage, ModelView, fields, sequence_ordered) from trytond.pool import Pool from trytond.pyson import Eval from trytond.transaction import Transaction @@ -136,7 +137,9 @@ class Email(ModelSQL, ModelView): @classmethod def get_models(cls): - return [(None, "")] + Pool().get('ir.model').get_name_items() + pool = Pool() + Model = pool.get('ir.model') + return [(None, "")] + Model.get_name_items((ModelStorage, ModelView)) @classmethod def from_webhook(cls, inbox, data, data_type):