Skip to content
Snippets Groups Projects
Commit a710c8eb authored by Xavier Manach's avatar Xavier Manach
Browse files

Remove debugs.

parent 9a89817b
No related branches found
No related tags found
No related merge requests found
...@@ -28,22 +28,7 @@ ...@@ -28,22 +28,7 @@
""" """
_inherit = 'email.template' _inherit = 'email.template'
print 'hooked_email_template'
def add_tracker_in_mail(self, values, context=None):
print values.body_text
print values.body_html
# CHANGE FROM ORIGINAL METHOD
print values.body_text
print values.body_html
return values
def send_mail(self, cr, uid, template_id, res_id, context=None): def send_mail(self, cr, uid, template_id, res_id, context=None):
"""Generates a new mail message for the given template and record, and schedule it for delivery through the ``mail`` module's scheduler. """Generates a new mail message for the given template and record, and schedule it for delivery through the ``mail`` module's scheduler.
:param int template_id: id of the template to render :param int res_id: id of the record to render the template with (model is taken from the template) """ :param int template_id: id of the template to render :param int res_id: id of the record to render the template with (model is taken from the template) """
...@@ -46,8 +31,7 @@ ...@@ -46,8 +31,7 @@
def send_mail(self, cr, uid, template_id, res_id, context=None): def send_mail(self, cr, uid, template_id, res_id, context=None):
"""Generates a new mail message for the given template and record, and schedule it for delivery through the ``mail`` module's scheduler. """Generates a new mail message for the given template and record, and schedule it for delivery through the ``mail`` module's scheduler.
:param int template_id: id of the template to render :param int res_id: id of the record to render the template with (model is taken from the template) """ :param int template_id: id of the template to render :param int res_id: id of the record to render the template with (model is taken from the template) """
print 'DEBUG send_mail XCG'
mail_message = self.pool.get('mail.message') mail_message = self.pool.get('mail.message')
ir_attachment = self.pool.get('ir.attachment') ir_attachment = self.pool.get('ir.attachment')
template = self.browse(cr, uid, template_id, context) template = self.browse(cr, uid, template_id, context)
...@@ -56,8 +40,7 @@ ...@@ -56,8 +40,7 @@
# here we need to use tracker so let's do it # here we need to use tracker so let's do it
tracker_base = context.get('tracker_base') tracker_base = context.get('tracker_base')
if values['body_text']: if values['body_text']:
print values['body_text']
values['body_text'], tracks = insert_tracker_in_text( values['body_text'], tracks = insert_tracker_in_text(
values['body_text'], values['body_text'],
tracker_base, tracker_base,
context['activity_id']) context['activity_id'])
...@@ -60,6 +43,5 @@ ...@@ -60,6 +43,5 @@
values['body_text'], tracks = insert_tracker_in_text( values['body_text'], tracks = insert_tracker_in_text(
values['body_text'], values['body_text'],
tracker_base, tracker_base,
context['activity_id']) context['activity_id'])
print values['body_text']
if values['body_html']: if values['body_html']:
...@@ -65,6 +47,5 @@ ...@@ -65,6 +47,5 @@
if values['body_html']: if values['body_html']:
print values['body_html']
values['body_html'], tracks = insert_tracker_in_html( values['body_html'], tracks = insert_tracker_in_html(
values['body_html'], values['body_html'],
tracker_base, tracker_base,
context['activity_id']) context['activity_id'])
...@@ -67,6 +48,5 @@ ...@@ -67,6 +48,5 @@
values['body_html'], tracks = insert_tracker_in_html( values['body_html'], tracks = insert_tracker_in_html(
values['body_html'], values['body_html'],
tracker_base, tracker_base,
context['activity_id']) context['activity_id'])
print values['body_html']
...@@ -72,3 +52,2 @@ ...@@ -72,3 +52,2 @@
print 'DEBUG 1'
trackitem = self.pool.get('marketing_campaign_tracker.trackitem') trackitem = self.pool.get('marketing_campaign_tracker.trackitem')
...@@ -74,5 +53,2 @@ ...@@ -74,5 +53,2 @@
trackitem = self.pool.get('marketing_campaign_tracker.trackitem') trackitem = self.pool.get('marketing_campaign_tracker.trackitem')
print 'DEBUG 2'
print trackitem
print dir(trackitem)
for trackvalues in tracks: for trackvalues in tracks:
...@@ -78,3 +54,2 @@ ...@@ -78,3 +54,2 @@
for trackvalues in tracks: for trackvalues in tracks:
print trackvalues
# create a trackitem for each URL that is replaced # create a trackitem for each URL that is replaced
...@@ -80,3 +55,2 @@ ...@@ -80,3 +55,2 @@
# create a trackitem for each URL that is replaced # create a trackitem for each URL that is replaced
print 'DEBUG 3'
trackitem.create(cr, uid, trackvalues, context=None) trackitem.create(cr, uid, trackvalues, context=None)
...@@ -82,5 +56,4 @@ ...@@ -82,5 +56,4 @@
trackitem.create(cr, uid, trackvalues, context=None) trackitem.create(cr, uid, trackvalues, context=None)
print 'DEBUG 4'
#values = self.add_tracker(cr, uid, template_id, res_id, context=context) #values = self.add_tracker(cr, uid, template_id, res_id, context=context)
attachments = values.pop('attachments') or {} attachments = values.pop('attachments') or {}
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
html_imgsrc_re = re.compile(r'img src="([-a-zA-Z0-9_/.?&=:]+)"') html_imgsrc_re = re.compile(r'img src="([-a-zA-Z0-9_/.?&=:]+)"')
def insert_tracker_in_text(text, tracker_base, activity_id): def insert_tracker_in_text(text, tracker_base, activity_id):
print 'ooooo'
tracks = [] tracks = []
def repl(match_obj): def repl(match_obj):
...@@ -46,7 +45,6 @@ ...@@ -46,7 +45,6 @@
return simple_text_url_re.sub(repl, text), tracks return simple_text_url_re.sub(repl, text), tracks
def insert_tracker_in_html(html, tracker_base, activity_id): def insert_tracker_in_html(html, tracker_base, activity_id):
print 'ooooohtml'
tracks = [] tracks = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment