Skip to content

Commit

Permalink
Fix migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
dufresnedavid committed Jun 13, 2016
1 parent 458ce02 commit 821899b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions addons/email_template/migrations/8.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import logging

from psycopg2.extensions import AsIs
from openerp.openupgrade import openupgrade

from openerp import SUPERUSER_ID
Expand Down Expand Up @@ -43,19 +44,14 @@ def convert_subject(subject):

for action in actions:

subject_column = openupgrade.get_legacy_name('subject')

env.cr.execute(
"""
SELECT openupgrade_legacy_email
, openupgrade_legacy_subject
, openupgrade_legacy_message
SELECT email, %s, message
FROM ir_act_server
WHERE id = %s
""", (
openupgrade.get_legacy_name('email'),
openupgrade.get_legacy_name('subject'),
openupgrade.get_legacy_name('message'),
action.id,
))
""", (AsIs(subject_column), action.id, ))

(email, subject, message) = env.cr.fetchone()

Expand Down

0 comments on commit 821899b

Please sign in to comment.