feat: grant portal access to app notifications, adjust image dimensions, fix controller base64 encoding, and close wizard on success
This commit is contained in:
parent
e7685c38c8
commit
d9a4b14a49
@ -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'])
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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
|
||||
|
||||
|
@ -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'},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user