mapan_loyalty_push/views/app_notification_views.xml

79 lines
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Tree View -->
<record id="view_mapan_app_notification_tree" model="ir.ui.view">
<field name="name">mapan.app.notification.tree</field>
<field name="model">mapan.app.notification</field>
<field name="arch" type="xml">
<list string="App Notifications" default_order="create_date desc">
<field name="create_date" string="Sent On"/>
<field name="title"/>
<field name="is_global"/>
</list>
</field>
</record>
<!-- Form View -->
<record id="view_mapan_app_notification_form" model="ir.ui.view">
<field name="name">mapan.app.notification.form</field>
<field name="model">mapan.app.notification</field>
<field name="arch" type="xml">
<form string="App Notification">
<sheet>
<div class="oe_title">
<h1>
<field name="title" placeholder="Notification Title"/>
</h1>
</div>
<group>
<group>
<field name="is_global"/>
<field name="create_date" string="Sent On" readonly="1"/>
</group>
<group>
<field name="image" widget="image" options="{'size': [0, 160]}"/>
</group>
</group>
<group string="Sent To" invisible="is_global == True">
<field name="partner_ids" widget="many2many_tags" nolabel="1"
options="{'no_create': True, 'no_open': True}"/>
</group>
<notebook>
<page string="Message Content">
<field name="body" widget="html"
placeholder="Enter the notification message content here..."/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Action -->
<record id="action_mapan_app_notification_history" model="ir.actions.act_window">
<field name="name">Notification History</field>
<field name="res_model">mapan.app.notification</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No notifications sent yet!
</p>
<p>
Use the "Send Push Notification" wizard to broadcast messages to your loyalty app users.
</p>
</field>
</record>
<menuitem id="menu_mapan_app_notification_history"
name="History"
parent="menu_mapan_mobile_app_root"
action="action_mapan_app_notification_history"
groups="mapan_loyalty_push.group_mapan_loyalty_push_user"
sequence="10"/>
<!-- Explicit Menu Override to clear and reset group_ids in Database -->
<record id="menu_mapan_app_notification_history" model="ir.ui.menu">
<field name="group_ids" eval="[(6, 0, [ref('mapan_loyalty_push.group_mapan_loyalty_push_user')])]"/>
</record>
</odoo>