diff --git a/controllers/main.py b/controllers/main.py index 1557f00..751f65f 100644 --- a/controllers/main.py +++ b/controllers/main.py @@ -54,7 +54,7 @@ class AppNotificationController(http.Controller): for notif in notifications: img = notif.get('image_128') if img and isinstance(img, bytes): - notif['image_128'] = b64mod.b64encode(img).decode('utf-8') + notif['image_128'] = img.decode('utf-8') elif not img: notif['image_128'] = None notif['has_image'] = bool(notif['image_128']) diff --git a/models/app_notification.py b/models/app_notification.py index 978b625..f76a411 100644 --- a/models/app_notification.py +++ b/models/app_notification.py @@ -11,8 +11,8 @@ class AppNotification(models.Model): # Optional promotional image — Odoo auto-generates image_128 thumbnail image = fields.Image( string='Notification Image', - max_width=1920, - max_height=1920, + max_width=1024, + max_height=1024, help='Optional image shown in the notification detail screen.' ) image_128 = fields.Image( diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 50a4360..2cb7df4 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -2,6 +2,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_mapan_push_wizard_manager,mapan_push_wizard_manager,model_mapan_push_wizard,mapan_loyalty_push.group_mapan_loyalty_push_manager,1,1,1,1 access_mapan_app_notification_user,mapan_app_notification_user,model_mapan_app_notification,mapan_loyalty_push.group_mapan_loyalty_push_user,1,0,0,0 access_mapan_app_notification_manager,mapan_app_notification_manager,model_mapan_app_notification,mapan_loyalty_push.group_mapan_loyalty_push_manager,1,1,1,1 +access_mapan_app_notification_portal,mapan_app_notification_portal,model_mapan_app_notification,base.group_portal,1,0,0,0 access_loyalty_card_portal,loyalty.card.portal,loyalty.model_loyalty_card,base.group_portal,1,0,0,0 access_loyalty_program_portal,loyalty.program.portal,loyalty.model_loyalty_program,base.group_portal,1,0,0,0 access_loyalty_history_portal,loyalty.history.portal,loyalty.model_loyalty_history,base.group_portal,1,0,0,0 diff --git a/wizard/push_wizard.py b/wizard/push_wizard.py index c9199f8..82926ed 100644 --- a/wizard/push_wizard.py +++ b/wizard/push_wizard.py @@ -53,5 +53,6 @@ class PushNotificationWizard(models.TransientModel): 'message': f'Notification staged for {target_msg}.', 'type': 'success', 'sticky': False, + 'next': {'type': 'ir.actions.act_window_close'}, } }