Initial squashed commit

This commit is contained in:
hoangvv
2026-05-12 18:58:14 +07:00
commit 0b5c2ce91a
54896 changed files with 28050323 additions and 0 deletions
+39
View 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>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo><data>
<record id="ir_actions_server_view_form" model="ir.ui.view">
<field name="name">ir.actions.server.view.form.inherit.sms</field>
<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"
placeholder="Choose a template..."
context="{'default_model': model_name}"
invisible="state != 'sms'"
required="state == 'sms'"/>
<label for="sms_method" invisible="state != 'sms'"/>
<div class="d-flex flex-column" invisible="state != 'sms'">
<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>
</xpath>
</field>
</record>
</data></odoo>
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<odoo><data>
<record id="mail_notification_view_tree" model="ir.ui.view">
<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">
<xpath expr="//field[@name='res_partner_id']" position="after">
<field name="sms_number"/>
</xpath>
</field>
</record>
<record id="mail_notification_view_form" model="ir.ui.view">
<field name="name">mail.notification.view.form</field>
<field name="model">mail.notification</field>
<field name="inherit_id" ref="mail.mail_notification_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='res_partner_id']" position="after">
<field name="sms_number"/>
</xpath>
<xpath expr="//field[@name='mail_mail_id']" position="after">
<field name="sms_id"/>
</xpath>
</field>
</record>
</data></odoo>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.sms</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
<field name="arch" type="xml">
<setting id="sms" position="inside">
<widget name="iap_buy_more_credits" service_name="sms" hide_service="1"/>
</setting>
</field>
</record>
</odoo>
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Add action entry in the Action Menu for Partners -->
<record id="res_partner_view_form" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit.sms</field>
<field name="model">res.partner</field>
<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">
<field name="phone_sanitized" groups="base.group_no_one" invisible="1"/>
</xpath>
<xpath expr="//field[@name='phone']" position="replace">
<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"
invisible="not phone_blacklisted"/>
<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"
invisible="not mobile_blacklisted"/>
<field name="mobile" widget="phone"/>
</div>
</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</field>
<field name="res_model">sms.composer</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{
'default_composition_mode': 'mass',
'default_mass_keep_log': True,
'default_res_ids': active_ids
}</field>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="binding_view_types">list</field>
</record>
<record id="res_partner_act_window_sms_composer_single" model="ir.actions.act_window">
<field name="name">Send SMS</field>
<field name="res_model">sms.composer</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{
'default_composition_mode': 'comment',
'default_res_id': active_id,
}</field>
<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>
+83
View File
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo><data>
<record id="sms_tsms_view_form" model="ir.ui.view">
<field name="name">sms.sms.view.form</field>
<field name="model">sms.sms</field>
<field name="arch" type="xml">
<form string="SMS">
<header>
<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" invisible="not mail_message_id"/>
</group>
<group>
<field name="number" required="1"/>
<field name="failure_type" readonly="1" invisible="not failure_type"/>
</group>
</group>
<group>
<field name="body" widget="sms_widget" string="Message" required="1"
readonly="state in ('process', 'sent')"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="sms_sms_view_tree" model="ir.ui.view">
<field name="name">sms.sms.view.list</field>
<field name="model">sms.sms</field>
<field name="arch" type="xml">
<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" 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>
<record id="sms_sms_view_search" model="ir.ui.view">
<field name="name">sms.sms.view.search</field>
<field name="model">sms.sms</field>
<field name="arch" type="xml">
<search string="Search SMS Templates">
<field name="number"/>
<field name="partner_id"/>
</search>
</field>
</record>
<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">list,form</field>
<field name="domain">[('to_delete', '!=', True)]</field>
</record>
<menuitem id="sms_sms_menu"
parent="phone_validation.phone_menu_main"
action="sms_sms_action"
sequence="1"/>
<record id="ir_actions_server_sms_sms_resend" model="ir.actions.server">
<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="state">code</field>
<field name="code">action = records.resend_failed()</field>
</record>
</data>
</odoo>
+99
View File
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo><data>
<record id="sms_template_view_form" model="ir.ui.view">
<field name="name">sms.template.view.form</field>
<field name="model">sms.template</field>
<field name="arch" type="xml">
<form string="SMS Templates">
<header>
<field name="template_fs" invisible="1"/>
<button string="Reset Template"
name="%(sms_template_reset_action)d" type="action"
groups="base.group_system"
invisible="not template_fs"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<field name="sidebar_action_id" invisible="1"/>
<button name="action_create_sidebar_action" type="object"
groups="base.group_no_one"
class="oe_stat_button"
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>
<span class="o_stat_text">Context Action</span>
</div>
</button>
<button name="action_unlink_sidebar_action" type="object"
groups="base.group_no_one"
class="oe_stat_button" icon="fa-minus"
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" 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"/>
<h1><field name="name" placeholder="e.g. Calendar Reminder" required="1"/></h1>
<group>
<field name="model_id" placeholder="e.g. Contact" required="1" options="{'no_create': True}"/>
<field name="model" invisible="1"/>
<field name="lang" groups="base.group_no_one" placeholder="e.g. en_US or {{ object.partner_id.lang }}"/>
</group>
</div>
<notebook>
<page string="Content" name="content">
<group>
<field name="body" widget="sms_widget" nolabel="1"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="sms_template_view_tree" model="ir.ui.view">
<field name="name">sms.template.view.list</field>
<field name="model">sms.template</field>
<field name="arch" type="xml">
<list string="SMS Templates">
<field name="name"/>
<field name="model_id"/>
</list>
</field>
</record>
<record id="sms_template_view_search" model="ir.ui.view">
<field name="name">sms.template.view.search</field>
<field name="model">sms.template</field>
<field name="arch" type="xml">
<search string="Search SMS Templates">
<field name="name"/>
<field name="model_id"/>
</search>
</field>
</record>
<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">list,form</field>
</record>
<menuitem id="sms_template_menu"
name="SMS Templates"
parent="phone_validation.phone_menu_main"
sequence="2"
action="sms_template_action"/>
</data></odoo>