mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-21 23:02:00 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
39
odoo-bringout-oca-ocb-sms/sms/views/iap_account_views.xml
Normal file
39
odoo-bringout-oca-ocb-sms/sms/views/iap_account_views.xml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="iap_account_view_form" model="ir.ui.view">
|
||||
<field name="name">iap.account.view.form</field>
|
||||
<field name="model">iap.account</field>
|
||||
<field name="inherit_id" ref="iap.iap_account_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='account']" position="before">
|
||||
<div role="status" class="alert alert-danger mb-0" invisible="service_name != 'sms' or (state != 'unregistered' and state)">
|
||||
<i class="fa fa-warning"/> You cannot send SMS while your account is not registered.
|
||||
<button type="object"
|
||||
name="action_open_registration_wizard" class="btn-link p-0">
|
||||
<i class="oi oi-arrow-right"/>
|
||||
Register
|
||||
</button>
|
||||
</div>
|
||||
<div role="status" class="alert alert-danger mb-0" invisible="service_name != 'sms' or (state != 'banned')">
|
||||
<i class="fa fa-warning"/> An error occurred with your account. Please contact the support for more information...
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_buy_credits']" position="attributes">
|
||||
<attribute name="invisible">service_name == 'sms' and not state</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='external']/*[1]" position="before">
|
||||
<label for="sender_name" class="oe_inline" invisible="service_name != 'sms' or not (state == 'registered' and state)"/>
|
||||
<div invisible="service_name != 'sms' or not (state == 'registered' and state)">
|
||||
<field name="sender_name" class="oe_inline" invisible="not sender_name"/>
|
||||
<button type="object" invisible="sender_name"
|
||||
name="action_open_sender_name_wizard" class="btn-link p-0">
|
||||
<i class="oi oi-arrow-right"/>
|
||||
Set Sender Name
|
||||
</button>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -6,15 +6,34 @@
|
|||
<field name="model">ir.actions.server</field>
|
||||
<field name="inherit_id" ref="base.view_server_action_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='link_field_id']" position="after">
|
||||
<field name="sms_template_id"
|
||||
context="{'default_model': model_name}"
|
||||
attrs="{'invisible': [('state', '!=', 'sms')],
|
||||
'required': [('state', '=', 'sms')]}"/>
|
||||
<field name="sms_method"
|
||||
string="Send as"
|
||||
attrs="{'invisible': [('state', '!=', 'sms')],
|
||||
'required': [('state', '=', 'sms')]}"/>
|
||||
<xpath expr="//t[@name='action_content']" position="inside">
|
||||
<group invisible="state != 'sms'">
|
||||
<group>
|
||||
<field name="sms_template_id"
|
||||
placeholder="Choose a template..."
|
||||
context="{'default_model': model_name}"
|
||||
required="state == 'sms'"/>
|
||||
<label for="sms_method"/>
|
||||
<div class="d-flex flex-column">
|
||||
<field name="sms_method" required="state == 'sms'"/>
|
||||
<div class="text-muted">
|
||||
<span invisible="sms_method != 'sms'">
|
||||
The message will be sent as an SMS to the recipients of the template
|
||||
and will not appear in the messaging history.
|
||||
</span>
|
||||
<span invisible="sms_method != 'note'">
|
||||
The SMS will not be sent, it will only be posted as an
|
||||
internal note in the messaging history.
|
||||
</span>
|
||||
<span invisible="sms_method != 'comment'">
|
||||
The SMS will be sent as an SMS to the recipients of the
|
||||
template and it will also be posted as an internal note
|
||||
in the messaging history.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<odoo><data>
|
||||
<record id="mail_notification_view_tree" model="ir.ui.view">
|
||||
<field name="name">mail.notification.view.tree</field>
|
||||
<field name="name">mail.notification.view.list</field>
|
||||
<field name="model">mail.notification</field>
|
||||
<field name="inherit_id" ref="mail.mail_notification_view_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="sms_settings" position="inside">
|
||||
<setting id="sms" position="inside">
|
||||
<widget name="iap_buy_more_credits" service_name="sms" hide_service="1"/>
|
||||
</div>
|
||||
</setting>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -8,39 +8,22 @@
|
|||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='mobile']" position="after">
|
||||
<xpath expr="//field[@name='phone']" position="after">
|
||||
<field name="phone_sanitized" groups="base.group_no_one" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='phone']" position="replace">
|
||||
<xpath expr="//field[@name='phone']" position="before">
|
||||
<field name="phone_blacklisted" invisible="1"/>
|
||||
<field name="mobile_blacklisted" invisible="1"/>
|
||||
<label for="phone" class="oe_inline"/>
|
||||
<div class="o_row o_row_readonly">
|
||||
<button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
|
||||
title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
|
||||
type="object" context="{'default_phone': phone}" groups="base.group_user"
|
||||
attrs="{'invisible': [('phone_blacklisted', '=', False)]}"/>
|
||||
<field name="phone" widget="phone"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='mobile']" position="replace">
|
||||
<field name="phone_blacklisted" invisible="1"/>
|
||||
<field name="mobile_blacklisted" invisible="1"/>
|
||||
<label for="mobile" class="oe_inline"/>
|
||||
<div class="o_row o_row_readonly">
|
||||
<button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
|
||||
title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
|
||||
type="object" context="{'default_phone': mobile}" groups="base.group_user"
|
||||
attrs="{'invisible': [('mobile_blacklisted', '=', False)]}"/>
|
||||
<field name="mobile" widget="phone"/>
|
||||
</div>
|
||||
<button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
|
||||
title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
|
||||
type="object" context="{'default_phone': phone}" groups="base.group_user"
|
||||
invisible="not phone_blacklisted"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Add action entry in the Action Menu for Partners -->
|
||||
<record id="res_partner_act_window_sms_composer_multi" model="ir.actions.act_window">
|
||||
<field name="name">Send SMS Text Message</field>
|
||||
<field name="name">Send SMS</field>
|
||||
<field name="res_model">sms.composer</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
|
|
@ -50,10 +33,10 @@
|
|||
'default_res_ids': active_ids
|
||||
}</field>
|
||||
<field name="binding_model_id" ref="base.model_res_partner"/>
|
||||
<field name="binding_view_types">list</field>
|
||||
<field name="binding_view_types">list,kanban</field>
|
||||
</record>
|
||||
<record id="res_partner_act_window_sms_composer_single" model="ir.actions.act_window">
|
||||
<field name="name">Send SMS Text Message</field>
|
||||
<field name="name">Send SMS</field>
|
||||
<field name="res_model">sms.composer</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
|
|
@ -64,16 +47,4 @@
|
|||
<field name="binding_model_id" ref="base.model_res_partner"/>
|
||||
<field name="binding_view_types">form</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_view_search" model="ir.ui.view">
|
||||
<field name="name">res.partner.view.search.inherit.sms</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_res_partner_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='phone']" position="replace">
|
||||
<field name="phone_mobile_search"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -6,24 +6,26 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="SMS">
|
||||
<header>
|
||||
<button name="send" string="Send Now" type="object" states='outgoing' class="oe_highlight"/>
|
||||
<button name="action_set_outgoing" string="Retry" type="object" states='error,canceled'/>
|
||||
<button name="action_set_canceled" string="Cancel" type="object" states='error,outgoing'/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
<field name="to_delete" invisible="1"/>
|
||||
<button name="send" string="Send Now" type="object" invisible="state != 'outgoing' or to_delete" class="oe_highlight"/>
|
||||
<button name="action_set_outgoing" string="Retry" type="object" invisible="state not in ('error', 'canceled')"/>
|
||||
<button name="action_set_canceled" string="Cancel" type="object" invisible="state not in ('error', 'outgoing')"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="outgoing,sent,error,canceled"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" string="Contact"/>
|
||||
<field name="mail_message_id" readonly="1" attrs="{'invisible': [('mail_message_id', '=', False)]}"/>
|
||||
<field name="mail_message_id" readonly="1" invisible="not mail_message_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="number" required="1"/>
|
||||
<field name="failure_type" readonly="1" attrs="{'invisible': [('failure_type', '=', False)]}"/>
|
||||
<field name="failure_type" readonly="1" invisible="not failure_type"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="body" widget="sms_widget" string="Message" required="1"/>
|
||||
<field name="body" widget="sms_widget" string="Message" required="1"
|
||||
readonly="state in ('process', 'sent')"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
@ -31,18 +33,18 @@
|
|||
</record>
|
||||
|
||||
<record id="sms_sms_view_tree" model="ir.ui.view">
|
||||
<field name="name">sms.sms.view.tree</field>
|
||||
<field name="name">sms.sms.view.list</field>
|
||||
<field name="model">sms.sms</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="SMS Templates">
|
||||
<list string="SMS Templates">
|
||||
<field name="number"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="failure_type"/>
|
||||
<field name="state" widget="badge" decoration-info="state == 'outgoing'" decoration-muted="state == 'canceled'" decoration-success="state == 'sent'" decoration-danger="state == 'error'"/>
|
||||
<button name="send" string="Send Now" type="object" icon="fa-paper-plane" states="outgoing"/>
|
||||
<button name="action_set_outgoing" string="Retry" type="object" icon="fa-repeat" states="error,canceled"/>
|
||||
<button name="action_set_canceled" string="Cancel" type="object" icon="fa-times-circle" states="error,outgoing"/>
|
||||
</tree>
|
||||
<button name="send" string="Send Now" type="object" icon="fa-paper-plane" invisible="state != 'outgoing'"/>
|
||||
<button name="action_set_outgoing" string="Retry" type="object" icon="fa-repeat" invisible="state not in ('error', 'canceled')"/>
|
||||
<button name="action_set_canceled" string="Cancel" type="object" icon="fa-times-circle" invisible="state not in ('error', 'outgoing')"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -60,7 +62,8 @@
|
|||
<record id="sms_sms_action" model="ir.actions.act_window">
|
||||
<field name="name">SMS</field>
|
||||
<field name="res_model">sms.sms</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="domain">[('to_delete', '!=', True)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="sms_sms_menu"
|
||||
|
|
@ -72,7 +75,7 @@
|
|||
<field name="name">Resend</field>
|
||||
<field name="model_id" ref="sms.model_sms_sms"/>
|
||||
<field name="binding_model_id" ref="sms.model_sms_sms"/>
|
||||
<field name="binding_view_types">list</field>
|
||||
<field name="binding_view_types">list,kanban</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = records.resend_failed()</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<button string="Reset Template"
|
||||
name="%(sms_template_reset_action)d" type="action"
|
||||
groups="base.group_system"
|
||||
attrs="{'invisible': [('template_fs', '=', False)]}"/>
|
||||
invisible="not template_fs"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<button name="action_create_sidebar_action" type="object"
|
||||
groups="base.group_no_one"
|
||||
class="oe_stat_button"
|
||||
attrs="{'invisible':[('sidebar_action_id','!=',False)]}" icon="fa-plus"
|
||||
invisible="sidebar_action_id" icon="fa-plus"
|
||||
help="Add a contextual action on the related model to open a sms composer with this template">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Add</span>
|
||||
|
|
@ -28,14 +28,18 @@
|
|||
<button name="action_unlink_sidebar_action" type="object"
|
||||
groups="base.group_no_one"
|
||||
class="oe_stat_button" icon="fa-minus"
|
||||
attrs="{'invisible':[('sidebar_action_id','=',False)]}"
|
||||
invisible="not sidebar_action_id"
|
||||
help="Remove the contextual action of the related model" widget="statinfo">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Remove</span>
|
||||
<span class="o_stat_text">Context Action</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="oe_stat_button" name="%(sms_template_preview_action)d" icon="fa-search-plus" string="Preview" type="action" target="new"/>
|
||||
<button class="oe_stat_button" name="%(sms_template_preview_action)d" icon="fa-search-plus" type="action" target="new">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Preview</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<label for="name" string="SMS Template"/>
|
||||
|
|
@ -49,7 +53,7 @@
|
|||
<notebook>
|
||||
<page string="Content" name="content">
|
||||
<group>
|
||||
<field name="body" widget="sms_widget" nolabel="1" colspan="2"/>
|
||||
<field name="body" widget="sms_widget" nolabel="1"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
|
@ -59,13 +63,13 @@
|
|||
</record>
|
||||
|
||||
<record id="sms_template_view_tree" model="ir.ui.view">
|
||||
<field name="name">sms.template.view.tree</field>
|
||||
<field name="name">sms.template.view.list</field>
|
||||
<field name="model">sms.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="SMS Templates">
|
||||
<list string="SMS Templates">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -83,7 +87,7 @@
|
|||
<record id="sms_template_action" model="ir.actions.act_window">
|
||||
<field name="name">Templates</field>
|
||||
<field name="res_model">sms.template</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="sms_template_menu"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue