[FIX] tools,mail: improve parsing of references from rev. 0bee015dd6

Backport of 8.0 fix was not enough for 7.0, because it still fails for the legacy reference match (model+res_id), which is not used in 8.0
This commit is contained in:
Denis Ledoux 2014-09-05 11:44:20 +02:00
parent 59b76ee927
commit d824769b3c
2 changed files with 1 additions and 2 deletions

View File

@ -29,7 +29,6 @@ import re
import socket import socket
import time import time
import xmlrpclib import xmlrpclib
import re
from email.message import Message from email.message import Message
from openerp import tools from openerp import tools

View File

@ -312,7 +312,7 @@ command_re = re.compile("^Set-([a-z]+) *: *(.+)$", re.I + re.UNICODE)
# Updated in 7.0 to match the model name as well # Updated in 7.0 to match the model name as well
# Typical form of references is <timestamp-openerp-record_id-model_name@domain> # Typical form of references is <timestamp-openerp-record_id-model_name@domain>
# group(1) = the record ID ; group(2) = the model (if any) ; group(3) = the domain # group(1) = the record ID ; group(2) = the model (if any) ; group(3) = the domain
reference_re = re.compile("<.*-open(?:object|erp)-(\\d+)(?:-([\w.]+))?.*@(.*)>", re.UNICODE) reference_re = re.compile("<.*-open(?:object|erp)-(\\d+)(?:-([\w.]+))?[^>]*@([^>]*)>", re.UNICODE)
def generate_tracking_message_id(res_id): def generate_tracking_message_id(res_id):
"""Returns a string that can be used in the Message-ID RFC822 header field """Returns a string that can be used in the Message-ID RFC822 header field