Tower: upload cetmix_tower_webhook 18.0.1.0.1 (was 18.0.1.0.1, via marketplace)

This commit is contained in:
2026-05-03 18:54:56 +00:00
parent ee7e3fb398
commit bf36bd383a
39 changed files with 5393 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<odoo>
<record id="cx_tower_variable_view_form" model="ir.ui.view">
<field name="name">cx.tower.variable.view.form</field>
<field name="model">cx.tower.variable</field>
<field
name="inherit_id"
ref="cetmix_tower_server.cx_tower_variable_view_form"
/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button
name="action_open_webhooks"
type="object"
class="oe_stat_button"
icon="fa-link"
invisible="webhook_ids_count == 0"
>
<field
name="webhook_ids_count"
widget="statinfo"
string="Webhooks"
/>
</button>
<button
name="action_open_webhook_authenticators"
type="object"
class="oe_stat_button"
icon="fa-key"
invisible="webhook_authenticator_ids_count == 0"
>
<field
name="webhook_authenticator_ids_count"
widget="statinfo"
string="Webhook Authenticators"
/>
</button>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="cx_tower_webhook_authenticator_view_form" model="ir.ui.view">
<field name="name">cx.tower.webhook.authenticator.view.form</field>
<field name="model">cx.tower.webhook.authenticator</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button
type="object"
name="action_view_logs"
string="Logs"
icon="fa-list"
class="oe_stat_button"
invisible="log_count == 0"
>
<field name="log_count" widget="statinfo" string="Logs" />
</button>
</div>
<group>
<group>
<field name="name" />
<field name="reference" />
<field
name="variable_ids"
widget="many2many_tags"
groups="cetmix_tower_server.group_manager,cetmix_tower_server.group_root"
readonly="1"
invisible="not variable_ids"
/>
<field
name="secret_ids"
widget="many2many_tags"
groups="cetmix_tower_server.group_manager,cetmix_tower_server.group_root"
invisible="not secret_ids"
/>
</group>
<group>
<field
name="allowed_ip_addresses"
placeholder="e.g.: 192.168.1.10, 192.168.2.0/24, 2001:db8::/32, 2a00:1450:4001:824::200e"
/>
<field
name="trusted_proxy_ips"
placeholder="10.0.0.1,192.168.1.0/24"
/>
</group>
</group>
<notebook>
<page name="code" string="Code">
<field
name="code"
widget="ace_tower"
options="{'mode': 'python'}"
placeholder="Enter Python code here. Help about Python expression is available in the help tab of this document"
/>
</page>
<page string="Help" name="python_help_info">
<field name="code_help" />
</page>
<page name="yaml" string="YAML">
<div groups="!cetmix_tower_yaml.group_export">
<h3
>You must be a member of the "YAML/Export" group to export data as YAML</h3>
</div>
<button
type="object"
groups="cetmix_tower_yaml.group_export"
class="oe_highlight"
name="action_open_yaml_export_wizard"
string="Export YAML"
/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="cx_tower_webhook_authenticator_view_tree" model="ir.ui.view">
<field name="name">cx.tower.webhook.authenticator.view.list</field>
<field name="model">cx.tower.webhook.authenticator</field>
<field name="arch" type="xml">
<list>
<field name="name" />
<field name="reference" optional="show" />
</list>
</field>
</record>
<record id="cx_tower_webhook_authenticator_view_search" model="ir.ui.view">
<field name="name">cx.tower.webhook.authenticator.view.search</field>
<field name="model">cx.tower.webhook.authenticator</field>
<field name="arch" type="xml">
<search string="Search Webhook Authenticators">
<field name="name" />
<field name="reference" />
</search>
</field>
</record>
<record id="cx_tower_webhook_authenticator_action" model="ir.actions.act_window">
<field name="name">Webhook Authenticators</field>
<field name="res_model">cx.tower.webhook.authenticator</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="cx_tower_webhook_authenticator_view_search" />
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add a new webhook authenticator
</p>
</field>
</record>
<record
id="action_cx_tower_webhook_authenticator_export_yaml"
model="ir.actions.act_window"
>
<field name="name">Export YAML</field>
<field name="res_model">cx.tower.yaml.export.wiz</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id" ref="model_cx_tower_webhook_authenticator" />
<field name="binding_view_types">list</field>
<field name="groups_id" eval="[(4, ref('cetmix_tower_yaml.group_export'))]" />
</record>
</odoo>

View File

@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="cx_tower_webhook_log_view_form" model="ir.ui.view">
<field name="name">cx.tower.webhook.log.view.form</field>
<field name="model">cx.tower.webhook.log</field>
<field name="arch" type="xml">
<form create="0">
<header>
<field
name="code_status"
widget="statusbar"
options="{'clickable': False}"
statusbar_visible="success,failed,skipped"
/>
</header>
<sheet>
<div class="oe_title">
<label for="display_name" class="oe_edit_only" />
<h1>
<field
name="display_name"
placeholder="Name"
required="1"
/>
</h1>
</div>
<group>
<group>
<field name="webhook_id" />
<field name="authenticator_id" />
<field name="endpoint" />
<field name="request_method" />
<field name="http_status" />
<field name="authentication_status" />
</group>
<group>
<field name="user_id" />
<field name="ip_address" />
<field name="country_id" />
<field name="create_date" />
</group>
</group>
<notebook>
<page name="request" string="Request Payload">
<field
name="request_payload"
widget="ace"
options="{'mode': 'json'}"
readonly="1"
/>
</page>
<page name="request_headers" string="Request Headers">
<field
name="request_headers"
widget="ace"
options="{'mode': 'json'}"
readonly="1"
/>
</page>
<page
name="response"
string="Response Payload"
invisible="code_status != 'success'"
>
<field
name="result_message"
widget="ace"
options="{'mode': 'json'}"
readonly="1"
/>
</page>
<page
name="error"
string="Error"
invisible="code_status != 'failed' and authentication_status != 'failed'"
>
<code>
<field name="error_message" readonly="1" />
</code>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="cx_tower_webhook_log_view_tree" model="ir.ui.view">
<field name="name">cx.tower.webhook.log.view.list</field>
<field name="model">cx.tower.webhook.log</field>
<field name="arch" type="xml">
<list
decoration-info="authentication_status == 'success' and code_status == 'success'"
decoration-danger="authentication_status == 'failed' or code_status == 'failed'"
decoration-warning="authentication_status == 'not_required' or code_status == 'skipped'"
>
<field name="create_date" />
<field name="webhook_id" />
<field name="endpoint" />
<field name="request_method" />
<field name="http_status" />
<field name="authentication_status" />
<field name="code_status" />
<field name="user_id" />
</list>
</field>
</record>
<record id="cx_tower_webhook_log_view_search" model="ir.ui.view">
<field name="name">cx.tower.webhook.log.view.search</field>
<field name="model">cx.tower.webhook.log</field>
<field name="arch" type="xml">
<search string="Webhook Logs">
<field name="webhook_id" />
<field name="endpoint" />
<field name="authentication_status" />
<field name="code_status" />
<field name="http_status" />
<field name="user_id" />
<field name="ip_address" />
<field name="create_date" />
<filter
name="auth_failed"
string="Auth Failed"
domain="[('authentication_status','=','failed')]"
/>
<filter
name="code_failed"
string="Code Failed"
domain="[('code_status','=','failed')]"
/>
<filter
name="http_200"
string="HTTP 200"
domain="[('http_status','=',200)]"
/>
<group expand="0" string="Group By">
<filter
name="group_by_webhook"
string="Webhook"
context="{'group_by': 'webhook_id'}"
/>
<filter
name="group_by_method"
string="Method"
context="{'group_by': 'request_method'}"
/>
<filter
name="group_by_user"
string="User"
context="{'group_by': 'user_id'}"
/>
<filter
name="group_by_auth_status"
string="Auth Status"
context="{'group_by': 'authentication_status'}"
/>
<filter
name="group_by_code_status"
string="Code Status"
context="{'group_by': 'code_status'}"
/>
<filter
name="group_by_http_status"
string="HTTP Status"
context="{'group_by': 'http_status'}"
/>
</group>
</search>
</field>
</record>
<record id="cx_tower_webhook_log_action" model="ir.actions.act_window">
<field name="name">Webhook Logs</field>
<field name="res_model">cx.tower.webhook.log</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="cx_tower_webhook_log_view_search" />
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No webhook logs found
</p>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,191 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="cx_tower_webhook_view_form" model="ir.ui.view">
<field name="name">cx.tower.webhook.view.form</field>
<field name="model">cx.tower.webhook</field>
<field name="arch" type="xml">
<form>
<sheet>
<widget
name="web_ribbon"
title="Disabled"
bg_color="bg-danger"
invisible="active"
/>
<div class="oe_button_box" name="button_box">
<button
type="object"
name="action_view_logs"
string="Logs"
icon="fa-list"
class="oe_stat_button"
invisible="log_count == 0"
>
<field name="log_count" widget="statinfo" string="Logs" />
</button>
</div>
<group>
<group>
<field name="name" />
<field name="reference" />
<field name="active" />
<field name="authenticator_id" />
<field
name="variable_ids"
widget="many2many_tags"
groups="cetmix_tower_server.group_manager,cetmix_tower_server.group_root"
readonly="1"
invisible="not variable_ids"
/>
<field
name="secret_ids"
widget="many2many_tags"
groups="cetmix_tower_server.group_manager,cetmix_tower_server.group_root"
invisible="not secret_ids"
/>
</group>
<group>
<field name="endpoint" />
<field
name="full_url"
invisible="not endpoint"
widget="CopyClipboardChar"
options="{'string': 'Copy'}"
/>
<field name="method" />
<field name="content_type" invisible="method == 'get'" />
<field name="user_id" context="{'active_test': False}" />
</group>
</group>
<notebook>
<page name="code" string="Code">
<field
name="code"
widget="ace_tower"
options="{'mode': 'python'}"
placeholder="Enter Python code here. Help about Python expression is available in the help tab of this document."
/>
</page>
<page string="Help" name="python_help_info">
<field name="code_help" />
</page>
<page name="yaml" string="YAML">
<div groups="!cetmix_tower_yaml.group_export">
<h3
>You must be a member of the "YAML/Export" group to export data as YAML.</h3>
</div>
<button
type="object"
groups="cetmix_tower_yaml.group_export"
class="oe_highlight"
name="action_open_yaml_export_wizard"
string="Export YAML"
/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="cx_tower_webhook_view_tree" model="ir.ui.view">
<field name="name">cx.tower.webhook.view.list</field>
<field name="model">cx.tower.webhook</field>
<field name="arch" type="xml">
<list decoration-muted="not active">
<field name="name" />
<field name="reference" optional="show" />
<field name="authenticator_id" optional="show" />
<field name="user_id" optional="show" />
<field name="endpoint" optional="show" />
<field name="method" optional="show" />
<field name="content_type" optional="show" />
<field name="active" widget="boolean_toggle" />
</list>
</field>
</record>
<record id="cx_tower_webhook_view_search" model="ir.ui.view">
<field name="name">cx.tower.webhook.view.search</field>
<field name="model">cx.tower.webhook</field>
<field name="arch" type="xml">
<search string="Search Webhooks">
<field
name="name"
string="Name/Reference"
filter_domain="['|', ('name', 'ilike', self), ('reference', 'ilike', self)]"
/>
<field name="endpoint" />
<filter
string="All"
name="all"
domain="['|', ('active', '=', True), ('active', '=', False)]"
/>
<filter
name="filter_enabled"
string="Enabled"
domain="[('active', '=', True)]"
/>
<filter
name="filter_disabled"
string="Disabled"
domain="[('active', '=', False)]"
/>
<group expand="0" string="Group By">
<filter
name="group_by_method"
string="Method"
context="{'group_by': 'method'}"
/>
<filter
name="group_by_authenticator_id"
string="Authenticator"
context="{'group_by': 'authenticator_id'}"
/>
<filter
name="group_by_user_id"
string="User"
context="{'group_by': 'user_id'}"
/>
<filter
name="group_by_content_type"
string="Content Type"
context="{'group_by': 'content_type'}"
/>
</group>
<searchpanel>
<field name="method" string="Method" icon="fa-cog" />
<field name="content_type" string="Content Type" icon="fa-file" />
<field
name="authenticator_id"
string="Authenticator"
icon="fa-shield"
/>
</searchpanel>
</search>
</field>
</record>
<record id="cx_tower_webhook_action" model="ir.actions.act_window">
<field name="name">Webhooks</field>
<field name="res_model">cx.tower.webhook</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="cx_tower_webhook_view_search" />
<field name="context">{'search_default_all': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add a new webhook
</p>
</field>
</record>
<record id="action_cx_tower_webhook_export_yaml" model="ir.actions.act_window">
<field name="name">Export YAML</field>
<field name="res_model">cx.tower.yaml.export.wiz</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id" ref="model_cx_tower_webhook" />
<field name="binding_view_types">list</field>
<field name="groups_id" eval="[(4, ref('cetmix_tower_yaml.group_export'))]" />
</record>
</odoo>

View File

@@ -0,0 +1,27 @@
<odoo>
<menuitem
id="menu_cetmix_tower_webhook_authenticator"
name="Webhook Authenticators"
action="cx_tower_webhook_authenticator_action"
parent="cetmix_tower_server.menu_cx_tower_automation_root"
groups="cetmix_tower_server.group_root"
sequence="3"
/>
<menuitem
id="menu_cetmix_tower_webhook"
name="Webhooks"
action="cx_tower_webhook_action"
parent="cetmix_tower_server.menu_cx_tower_automation_root"
groups="cetmix_tower_server.group_root"
sequence="4"
/>
<menuitem
id="menu_cetmix_tower_webhook_log"
name="Webhook Calls"
action="cx_tower_webhook_log_action"
parent="cetmix_tower_server.menu_cx_tower_log_root"
sequence="150"
/>
</odoo>

View File

@@ -0,0 +1,24 @@
<?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</field>
<field name="model">res.config.settings</field>
<field
name="inherit_id"
ref="cetmix_tower_server.res_config_settings_view_form"
/>
<field name="arch" type="xml">
<xpath
expr="//block[@name='cetmix_tower_server_settings']"
position="inside"
>
<setting
id="cetmix_tower_webhook_log_duration"
help="Set the number of days to keep webhook logs. Old logs will be deleted automatically."
>
<field name="cetmix_tower_webhook_log_duration" />
</setting>
</xpath>
</field>
</record>
</odoo>