From 2d083e9589be4949db8405e471a46ed82d7f9482 Mon Sep 17 00:00:00 2001 From: Ronaldo Cuentas Alave Date: Tue, 13 Aug 2024 11:53:00 +0200 Subject: [PATCH] add generic template button --- poweremail_generic_template/__terp__.py | 1 + .../banner_generic_email_template_button.xml | 16 ++++++++++++++++ .../emails/generic/components/button/en.mako | 3 +++ .../emails/generic/index.mako | 1 + .../post-0002_load_generic_template_button.py | 14 ++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 poweremail_generic_template/data/banners/banner_generic_email_template_button.xml create mode 100644 poweremail_generic_template/emails/generic/components/button/en.mako create mode 100644 poweremail_generic_template/migrations/5.0.24.9.0/post-0002_load_generic_template_button.py diff --git a/poweremail_generic_template/__terp__.py b/poweremail_generic_template/__terp__.py index 482db27..dc63aba 100644 --- a/poweremail_generic_template/__terp__.py +++ b/poweremail_generic_template/__terp__.py @@ -19,6 +19,7 @@ "data/banners/banner_generic_email_template_footer.xml", "data/banners/banner_generic_email_template_css.xml", "data/banners/banner_generic_email_template_company.xml", + "data/banners/banner_generic_email_template_button.xml", ], "active": False, "installable": True diff --git a/poweremail_generic_template/data/banners/banner_generic_email_template_button.xml b/poweremail_generic_template/data/banners/banner_generic_email_template_button.xml new file mode 100644 index 0000000..3bd2711 --- /dev/null +++ b/poweremail_generic_template/data/banners/banner_generic_email_template_button.xml @@ -0,0 +1,16 @@ + + + + + + diff --git a/poweremail_generic_template/emails/generic/components/button/en.mako b/poweremail_generic_template/emails/generic/components/button/en.mako new file mode 100644 index 0000000..5b73b63 --- /dev/null +++ b/poweremail_generic_template/emails/generic/components/button/en.mako @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/poweremail_generic_template/emails/generic/index.mako b/poweremail_generic_template/emails/generic/index.mako index 00a3493..2dc4a3a 100644 --- a/poweremail_generic_template/emails/generic/index.mako +++ b/poweremail_generic_template/emails/generic/index.mako @@ -24,6 +24,7 @@ env['company'] = company ctx = { 'lang': lang, 'raise_exception': True, + 'banners': banners, } ctx.update(env) diff --git a/poweremail_generic_template/migrations/5.0.24.9.0/post-0002_load_generic_template_button.py b/poweremail_generic_template/migrations/5.0.24.9.0/post-0002_load_generic_template_button.py new file mode 100644 index 0000000..53ddd66 --- /dev/null +++ b/poweremail_generic_template/migrations/5.0.24.9.0/post-0002_load_generic_template_button.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from oopgrade.oopgrade import load_data +from tools import config + + +def up(cursor, installed_version): + if not installed_version or config.updating_all: + return + load_data(cursor, 'poweremail_generic_template', 'data/banners/banner_generic_email_template_button.xml') + +def down(cursor, installed_version): + pass + +migrate = up \ No newline at end of file