Files
enterprise-addons/social_push_notifications/views/social_post_template_views.xml
T

77 lines
4.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="social_post_template_view_form" model="ir.ui.view">
<field name="name">social.post.template.view.form.inherit.social.push.notifications</field>
<field name="model">social.post.template</field>
<field name="priority">20</field>
<field name="inherit_id" ref="social.social_post_template_view_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='social_post_global']" position="inside">
<div name="notification_request_parameters" colspan="2"
class="o_horizontal_separator mt-5"
invisible="not has_push_notifications_account or is_split_per_media">
Push Notification Options
</div>
<field name="has_push_notifications_account"
invisible="1"/>
<field name="push_notification_title"
string="Notification Title"
required="has_push_notifications_account"
invisible="not has_push_notifications_account or is_split_per_media"/>
<field name="push_notification_target_url"
string="Target URL"
invisible="not has_push_notifications_account or is_split_per_media"/>
<field name="push_notification_image" widget="image"
class="o_push_notification_image_field"
string="Icon Image"
invisible="not has_push_notifications_account or is_split_per_media"/>
<field nolabel="1" colspan="2" name="visitor_domain" widget="domain"
options="{'foldable': True, 'model': 'website.visitor'}"
invisible="not has_push_notifications_account or is_split_per_media"/>
</xpath>
<xpath expr="//div[hasclass('o_social_post_preview_container')]" position="inside">
<field name="has_push_notifications_account" invisible="1"/>
<field name="display_push_notifications_preview" invisible="1" />
<field name="push_notifications_preview" nolabel="1" colspan="2"
widget="social_post_preview"
media_type="push_notifications"
readonly="1"
invisible="not display_push_notifications_preview" />
</xpath>
<xpath expr="//field[@name='message']" position="attributes">
<attribute name="required">(has_push_notifications_account or not image_ids) and not is_split_per_media</attribute>
</xpath>
<xpath expr="//notebook[@name='media_customization']" position="inside">
<page string="Push Notification" name="push_notifications_content"
invisible="not has_push_notifications_account">
<group>
<group>
<field name="push_notification_title"
string="Notification Title"
required="is_split_per_media and has_push_notifications_account"/>
<field name="push_notification_message"
string="Message"
required="is_split_per_media and has_push_notifications_account"/>
<field name="push_notification_target_url"
string="Target URL"/>
<field name="push_notification_image" widget="image"
class="o_push_notification_image_field"
string="Icon Image"/>
<field nolabel="1" colspan="2" name="visitor_domain" widget="domain"
options="{'foldable': True, 'model': 'website.visitor'}"/>
</group>
<group invisible="not display_push_notifications_preview">
<field name="push_notifications_preview" nolabel="1"
widget="social_post_preview"
media_type="push_notifications"
readonly="1"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</data>
</odoo>