02.02.26
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user