From d0c8002457055e1d79a47d5caae5091a6219f399 Mon Sep 17 00:00:00 2001 From: saul-timoteo Date: Wed, 30 Oct 2024 11:58:10 +0100 Subject: [PATCH 1/2] feat: add menuitem and migration script --- ...01_add_menu_item_for_sending_mail_state.py | 22 +++++++++++++++++++ poweremail_mailbox_view.xml | 21 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py diff --git a/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py b/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py new file mode 100644 index 0000000..18a80cc --- /dev/null +++ b/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from tools import config +from oopgrade.oopgrade import load_data_records + + +def up(cursor, installed_version): + if not installed_version or config.updating_all: + return + load_data_records( + cursor, 'poweremail', "poweremail_mailbox_view.xml", [ + "action_poweremail_sending_tree", + "action_poweremail_sending_tree_company", + "menu_action_poweremail_sending_tree_company", + "menu_action_poweremail_sending_tree" + ], mode='update') + + +def down(cursor, installed_version): + pass + + +migrate = up diff --git a/poweremail_mailbox_view.xml b/poweremail_mailbox_view.xml index 193fed2..64cc39e 100644 --- a/poweremail_mailbox_view.xml +++ b/poweremail_mailbox_view.xml @@ -324,6 +324,15 @@ [('folder','=','sent'),('pem_user','=',uid)] + + + Mailbox: Sending + poweremail.mailbox + form + form,tree + + [('state','=','sending')] + Mailbox: Trash @@ -393,6 +402,16 @@ [('folder','=','sent')] {'company':True} + + + Mailbox: Sending + poweremail.mailbox + form + form,tree + + [('state','=','sending')] + {'company':True} + Mailbox: Trash @@ -423,6 +442,7 @@ + @@ -432,6 +452,7 @@ + From dc4aef9c1448bde35bfb821e496aa138d37a1a37 Mon Sep 17 00:00:00 2001 From: saul-timoteo Date: Wed, 30 Oct 2024 12:32:19 +0100 Subject: [PATCH 2/2] fix: migration mode init --- .../post-0001_add_menu_item_for_sending_mail_state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py b/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py index 18a80cc..22b1941 100644 --- a/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py +++ b/migrations/5.0.25.1.0/post-0001_add_menu_item_for_sending_mail_state.py @@ -12,7 +12,7 @@ def up(cursor, installed_version): "action_poweremail_sending_tree_company", "menu_action_poweremail_sending_tree_company", "menu_action_poweremail_sending_tree" - ], mode='update') + ], mode='init') def down(cursor, installed_version):