diff --git a/PORTING.md b/PORTING.md index 6d869f7..78790b4 100644 --- a/PORTING.md +++ b/PORTING.md @@ -17,18 +17,22 @@ instance unverified. ## API porting checklist (verify on a real Odoo 14.0 instance) -- [ ] **Mail template syntax — REVERT to Jinja2.** Odoo 14 renders `mail.template` with Jinja2 - (`${object.blog_post_id.name}`, `% if`, `% for`), **not** the qweb `` used on 17.0. - The 17.0 template in `data/mail_template_data.xml` must be converted back to Jinja for 14.0. -- [ ] **Mail render API.** 14.0 uses `template.render_template(...)` / `_render_template(...)`, - not 17.0's `_render_field`. Update `blog_generation_log.send_notification_email` + tests. +- [x] **Mail template syntax — reverted to Jinja2.** `data/mail_template_data.xml` restored to + Odoo 14's Jinja2 (`${...}`, `% if`, `% for`) instead of the 17.0 qweb `type="html"`. +- [x] **View conditional attributes → `attrs`.** Converted the 6 Odoo-17-style + `invisible="state == '…'"` attributes (blog_topic, blog_generation_log) to Odoo 14 + `attrs="{'invisible': [domain]}"`. +- [~] **Mail render API.** Odoo 14 `_render_field(field, res_ids, engine='jinja')` exists — the + tests' `_render_field('subject', [id])` should work now that the template is Jinja. Verify live. +- [~] Python: `'ImageResult | None'` in `image_router.py` is a quoted (3.7-safe) annotation; no + walrus / 3.9 subscript generics found. +- [ ] `data-test-id` attributes in views — confirm Odoo 14 RNG accepts them (Playwright-only; + may need removal/guarding on 14). - [ ] `blog.post` body field name on 14.0 (the 17.0 baseline writes `content` — confirm 14.0). -- [ ] Python 3.6–3.8 only — remove any 3.9+ syntax (dict `|` merge, `str.removeprefix`, etc.). - [ ] `@api.model_create_multi`, `name_get`, and other ORM signatures valid on 14.0. -- [ ] View/RELAXNG validation for 14.0 (attrs/states syntax differs from 17.0). - [ ] `ir.cron` + mail data XML formats. +- [ ] pytest / pytest-odoo / pytest-bdd versions compatible with odoo:14.0's Python 3.7. - [ ] Full test suite green on a 14.0 template DB (K8s job, §8, base image `odoo:14.0`). -- [ ] pytest-odoo / pytest-bdd versions compatible with the 14.0 Python. ## How to work this branch diff --git a/addons/itsulu_blog_publisher/data/mail_template_data.xml b/addons/itsulu_blog_publisher/data/mail_template_data.xml index 3809791..70fb10a 100644 --- a/addons/itsulu_blog_publisher/data/mail_template_data.xml +++ b/addons/itsulu_blog_publisher/data/mail_template_data.xml @@ -2,47 +2,48 @@ + Blog Publisher — Post Published Notification - [ITSulu Insights] Blog Post Published: {{ object.blog_post_id.name }} - {{ user.email_formatted }} + [ITSulu Insights] Blog Post Published: ${object.blog_post_id.name} + ${user.email_formatted} True - -
-

Blog Post Published

-

Title:

-

Blog:

-

URL: https://itsulu.com

-

Social Media Posts — Ready to Post

- - -

Twitter

-

-
- -

Twitter

-

-
- -

BlueSky

-

-
- -

BlueSky

-

-
- -

Mastodon

-

-
- -

LinkedIn

-

-
-
-
-
+ +

Blog Post Published

+

Title: ${object.blog_post_id.name}

+

Blog: ${object.blog_post_id.blog_id.name}

+

URL: https://itsulu.com${object.blog_post_id.website_url}

+

Social Media Posts — Ready to Post

+% for social in object.blog_post_id.itsulu_social_id: +% if social.twitter_post_a: +

Twitter

+

${social.twitter_post_a}

+% endif +% if social.twitter_post_b: +

Twitter

+

${social.twitter_post_b}

+% endif +% if social.bluesky_post_a: +

BlueSky

+

${social.bluesky_post_a}

+% endif +% if social.bluesky_post_b: +

BlueSky

+

${social.bluesky_post_b}

+% endif +% if social.mastodon_post: +

Mastodon

+

${social.mastodon_post}

+% endif +% if social.linkedin_post: +

LinkedIn

+

${social.linkedin_post}

+% endif +% endfor + + ]]>
diff --git a/addons/itsulu_blog_publisher/views/blog_generation_log_views.xml b/addons/itsulu_blog_publisher/views/blog_generation_log_views.xml index 37ccafe..eb3ac9a 100644 --- a/addons/itsulu_blog_publisher/views/blog_generation_log_views.xml +++ b/addons/itsulu_blog_publisher/views/blog_generation_log_views.xml @@ -34,7 +34,7 @@
@@ -43,7 +43,7 @@ - + diff --git a/addons/itsulu_blog_publisher/views/blog_topic_views.xml b/addons/itsulu_blog_publisher/views/blog_topic_views.xml index afd7de5..8ab273b 100644 --- a/addons/itsulu_blog_publisher/views/blog_topic_views.xml +++ b/addons/itsulu_blog_publisher/views/blog_topic_views.xml @@ -20,10 +20,10 @@ decoration-warning="state=='skipped'"/>