This commit is contained in:
2026-02-02 08:42:48 +01:00
parent 62c2080fee
commit 7b669a27a8
3 changed files with 33 additions and 8 deletions

View File

@@ -4,7 +4,8 @@
from trytond.model import fields
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval
import logging
logger = logging.getLogger(__name__)
class Rule(metaclass=PoolMeta):
__name__ = 'inbound.email.rule'
@@ -64,6 +65,8 @@ class Rule(metaclass=PoolMeta):
return
data = email_.as_dict()
body = data.get('text') or data.get('html')
logger.info("BODY:%s",body)
attachments = data.get('attachments') or []
# 👉 S'il y avait des pièces jointes, le module standard a déjà créé les documents
@@ -73,7 +76,7 @@ class Rule(metaclass=PoolMeta):
return
# 🚨 Aucune pièce jointe → on crée un document depuis le corps du mail
body = data.get('text') or data.get('html')
if not body:
return # rien à créer