-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from gisce/52649_show_model_data_name_in_powe…
…remail_templates Añadir el model data name en el formulario de las plantillas de email
- Loading branch information
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
migrations/5.0.23.12.0/post-0001_add_model_data_name_in_poweremail_templates.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
import logging | ||
from oopgrade.oopgrade import load_data_records | ||
import pooler | ||
|
||
|
||
def up(cursor, installed_version): | ||
if not installed_version: | ||
return | ||
|
||
pool = pooler.get_pool(cursor.dbname) | ||
logger = logging.getLogger('openerp.migration') | ||
|
||
logger.info("Adding related column to poweremail.templates") | ||
pool.get("poweremail.templates")._auto_init(cursor, context={'module': 'poweremail'}) | ||
logger.info("Related column loaded successfully.") | ||
|
||
view = "poweremail_template_view.xml" | ||
view_record = [ | ||
"poweremail_template_form", | ||
] | ||
logger.info("Updating XML {}".format(view)) | ||
|
||
load_data_records(cursor, 'poweremail', view, view_record, mode='update') | ||
|
||
logger.info("XMLs succesfully updated.") | ||
|
||
|
||
def down(cursor, installed_version): | ||
pass | ||
|
||
|
||
migrate = up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters