Initial commit
This commit is contained in:
31
fusion_faxes/views/account_move_views.xml
Normal file
31
fusion_faxes/views/account_move_views.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Add Send Fax button + smart button to invoice form -->
|
||||
<record id="view_account_move_form_inherit_fusion_faxes" model="ir.ui.view">
|
||||
<field name="name">account.move.form.inherit.fusion_faxes</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Smart button for fax count -->
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_faxes" type="object"
|
||||
class="oe_stat_button" icon="fa-fax"
|
||||
invisible="x_ff_fax_count == 0">
|
||||
<field name="x_ff_fax_count" widget="statinfo" string="Faxes"/>
|
||||
</button>
|
||||
</xpath>
|
||||
|
||||
<!-- Send Fax header button -->
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="action_send_fax" string="Send Fax"
|
||||
type="object" class="btn-secondary"
|
||||
icon="fa-fax"
|
||||
groups="fusion_faxes.group_fax_user"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
156
fusion_faxes/views/dashboard_views.xml
Normal file
156
fusion_faxes/views/dashboard_views.xml
Normal file
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Dashboard Form View -->
|
||||
<record id="view_fusion_fax_dashboard_form" model="ir.ui.view">
|
||||
<field name="name">fusion.fax.dashboard.form</field>
|
||||
<field name="model">fusion.fax.dashboard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fax Dashboard" create="0" delete="0" edit="0">
|
||||
<sheet>
|
||||
<field name="name" invisible="1"/>
|
||||
<!-- Title -->
|
||||
<div class="mb-4">
|
||||
<span class="text-muted">Overview of fax activity and quick actions</span>
|
||||
</div>
|
||||
|
||||
<!-- KPI Stat Cards -->
|
||||
<div class="d-flex flex-nowrap gap-3 mb-4">
|
||||
|
||||
<!-- Total Faxes -->
|
||||
<div class="flex-fill">
|
||||
<button name="action_open_all" type="object"
|
||||
class="btn btn-primary w-100 p-0 border-0 rounded-3">
|
||||
<div class="text-center py-3 px-2">
|
||||
<div class="fw-bold" style="font-size: 2rem;">
|
||||
<field name="total_count"/>
|
||||
</div>
|
||||
<div style="font-size: 0.85rem;">Total Faxes</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Sent -->
|
||||
<div class="flex-fill">
|
||||
<button name="action_open_sent" type="object"
|
||||
class="btn btn-success w-100 p-0 border-0 rounded-3">
|
||||
<div class="text-center py-3 px-2">
|
||||
<div class="fw-bold" style="font-size: 2rem;">
|
||||
<field name="sent_count"/>
|
||||
</div>
|
||||
<div style="font-size: 0.85rem;">Sent</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Received -->
|
||||
<div class="flex-fill">
|
||||
<button name="action_open_received" type="object"
|
||||
class="btn btn-info w-100 p-0 border-0 rounded-3">
|
||||
<div class="text-center py-3 px-2">
|
||||
<div class="fw-bold" style="font-size: 2rem;">
|
||||
<field name="received_count"/>
|
||||
</div>
|
||||
<div style="font-size: 0.85rem;">Received</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Failed -->
|
||||
<div class="flex-fill" invisible="failed_count == 0">
|
||||
<button name="action_open_failed" type="object"
|
||||
class="btn btn-danger w-100 p-0 border-0 rounded-3">
|
||||
<div class="text-center py-3 px-2">
|
||||
<div class="fw-bold" style="font-size: 2rem;">
|
||||
<field name="failed_count"/>
|
||||
</div>
|
||||
<div style="font-size: 0.85rem;">Failed</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Draft -->
|
||||
<div class="flex-fill" invisible="draft_count == 0">
|
||||
<button name="action_open_draft" type="object"
|
||||
class="btn btn-warning w-100 p-0 border-0 rounded-3">
|
||||
<div class="text-center py-3 px-2">
|
||||
<div class="fw-bold" style="font-size: 2rem;">
|
||||
<field name="draft_count"/>
|
||||
</div>
|
||||
<div style="font-size: 0.85rem;">Draft</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Quick Action Buttons -->
|
||||
<div class="d-flex gap-2 mb-4">
|
||||
<button name="action_send_fax" type="object"
|
||||
class="btn btn-primary"
|
||||
icon="fa-fax">
|
||||
Send New Fax
|
||||
</button>
|
||||
<button name="action_open_all" type="object"
|
||||
class="btn btn-secondary"
|
||||
icon="fa-list">
|
||||
View All Faxes
|
||||
</button>
|
||||
<button name="action_open_received" type="object"
|
||||
class="btn btn-secondary"
|
||||
icon="fa-download">
|
||||
View Received
|
||||
</button>
|
||||
<button name="action_open_failed" type="object"
|
||||
class="btn btn-secondary"
|
||||
icon="fa-exclamation-triangle"
|
||||
invisible="failed_count == 0">
|
||||
View Failed
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Recent Fax History -->
|
||||
<separator string="Recent Fax History"/>
|
||||
<field name="recent_fax_ids" nolabel="1" readonly="1">
|
||||
<list decoration-danger="state == 'failed'"
|
||||
decoration-success="state in ('sent', 'received')"
|
||||
decoration-info="state == 'sending'">
|
||||
<field name="name"/>
|
||||
<field name="direction" widget="badge"
|
||||
decoration-info="direction == 'outbound'"
|
||||
decoration-success="direction == 'inbound'"/>
|
||||
<field name="display_date" string="Date"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="display_number" string="Fax Number"/>
|
||||
<field name="page_count"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-success="state in ('sent', 'received')"
|
||||
decoration-danger="state == 'failed'"
|
||||
decoration-info="state == 'sending'"
|
||||
decoration-warning="state == 'draft'"/>
|
||||
<field name="sent_by_id" optional="show"/>
|
||||
</list>
|
||||
</field>
|
||||
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Dashboard Action -->
|
||||
<record id="action_fusion_fax_dashboard" model="ir.actions.act_window">
|
||||
<field name="name">Dashboard</field>
|
||||
<field name="res_model">fusion.fax.dashboard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_fusion_fax_dashboard_form"/>
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
||||
<!-- Dashboard Menu (first item under Faxes root) -->
|
||||
<menuitem id="menu_fusion_fax_dashboard"
|
||||
name="Dashboard"
|
||||
parent="menu_fusion_faxes_root"
|
||||
action="action_fusion_fax_dashboard"
|
||||
sequence="1"/>
|
||||
|
||||
</odoo>
|
||||
259
fusion_faxes/views/fusion_fax_views.xml
Normal file
259
fusion_faxes/views/fusion_fax_views.xml
Normal file
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Fax Form View -->
|
||||
<record id="view_fusion_fax_form" model="ir.ui.view">
|
||||
<field name="name">fusion.fax.form</field>
|
||||
<field name="model">fusion.fax</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fax">
|
||||
<header>
|
||||
<!-- Outbound buttons only -->
|
||||
<button name="action_send" string="Send Fax"
|
||||
type="object" class="btn-primary"
|
||||
icon="fa-fax"
|
||||
invisible="state != 'draft' or direction == 'inbound'"/>
|
||||
<button name="action_resend" string="Resend Fax"
|
||||
type="object" class="btn-primary"
|
||||
icon="fa-repeat"
|
||||
invisible="state != 'sent' or direction == 'inbound'"
|
||||
confirm="This will resend the fax with all attachments. Continue?"/>
|
||||
<button name="action_retry" string="Retry"
|
||||
type="object" class="btn-primary"
|
||||
icon="fa-refresh"
|
||||
invisible="state != 'failed' or direction == 'inbound'"/>
|
||||
<button name="action_reset_to_draft" string="Reset to Draft"
|
||||
type="object"
|
||||
invisible="state != 'failed' or direction == 'inbound'"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,sending,sent,received"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_open_sale_order" type="object"
|
||||
class="oe_stat_button" icon="fa-shopping-cart"
|
||||
invisible="not sale_order_id">
|
||||
<field name="sale_order_id" widget="statinfo" string="Sale Order"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<!-- Direction badge -->
|
||||
<div class="mb-3">
|
||||
<field name="direction" widget="badge"
|
||||
decoration-info="direction == 'outbound'"
|
||||
decoration-success="direction == 'inbound'"
|
||||
readonly="1"/>
|
||||
</div>
|
||||
|
||||
<!-- Outbound fields -->
|
||||
<group invisible="direction == 'inbound'">
|
||||
<group>
|
||||
<field name="partner_id"/>
|
||||
<field name="fax_number"/>
|
||||
<field name="sent_by_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sent_date"/>
|
||||
<field name="page_count"/>
|
||||
<field name="ringcentral_message_id"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- Inbound fields -->
|
||||
<group invisible="direction == 'outbound'">
|
||||
<group>
|
||||
<field name="sender_number"/>
|
||||
<field name="partner_id" string="Matched Contact"/>
|
||||
<field name="sale_order_id" string="Link to Sale Order"
|
||||
options="{'no_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="received_date"/>
|
||||
<field name="page_count"/>
|
||||
<field name="rc_read_status"/>
|
||||
<field name="ringcentral_message_id"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group invisible="direction == 'inbound'">
|
||||
<field name="cover_page_text" placeholder="Optional cover page text..."/>
|
||||
</group>
|
||||
|
||||
<!-- Ordered Documents with preview -->
|
||||
<separator string="Documents"/>
|
||||
<field name="document_ids" nolabel="1">
|
||||
<list editable="bottom">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="attachment_id"/>
|
||||
<field name="file_name" readonly="1"/>
|
||||
<field name="mimetype" readonly="1"/>
|
||||
<button name="action_preview" type="object"
|
||||
string="Preview" icon="fa-eye"
|
||||
class="btn-link"/>
|
||||
</list>
|
||||
</field>
|
||||
|
||||
<group string="Linked Records"
|
||||
invisible="direction == 'inbound'">
|
||||
<group>
|
||||
<field name="sale_order_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="account_move_id"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Error Details" invisible="state != 'failed'">
|
||||
<field name="error_message" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<chatter/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Fax List View -->
|
||||
<record id="view_fusion_fax_list" model="ir.ui.view">
|
||||
<field name="name">fusion.fax.list</field>
|
||||
<field name="model">fusion.fax</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Faxes" decoration-danger="state == 'failed'"
|
||||
decoration-success="state in ('sent', 'received')"
|
||||
decoration-info="state == 'sending'">
|
||||
<field name="name"/>
|
||||
<field name="direction" widget="badge"
|
||||
decoration-info="direction == 'outbound'"
|
||||
decoration-success="direction == 'inbound'"/>
|
||||
<field name="display_date" string="Date"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="display_number" string="Fax Number"/>
|
||||
<field name="page_count"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-success="state in ('sent', 'received')"
|
||||
decoration-danger="state == 'failed'"
|
||||
decoration-info="state == 'sending'"
|
||||
decoration-warning="state == 'draft'"/>
|
||||
<field name="sent_by_id" optional="show"/>
|
||||
<field name="sale_order_id" optional="hide"/>
|
||||
<field name="account_move_id" optional="hide"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Fax Search View -->
|
||||
<record id="view_fusion_fax_search" model="ir.ui.view">
|
||||
<field name="name">fusion.fax.search</field>
|
||||
<field name="model">fusion.fax</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Faxes">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="fax_number"/>
|
||||
<field name="sender_number"/>
|
||||
<field name="sale_order_id"/>
|
||||
<field name="account_move_id"/>
|
||||
<separator/>
|
||||
<filter string="Outbound" name="filter_outbound"
|
||||
domain="[('direction', '=', 'outbound')]"/>
|
||||
<filter string="Inbound" name="filter_inbound"
|
||||
domain="[('direction', '=', 'inbound')]"/>
|
||||
<separator/>
|
||||
<filter string="Draft" name="filter_draft"
|
||||
domain="[('state', '=', 'draft')]"/>
|
||||
<filter string="Sent" name="filter_sent"
|
||||
domain="[('state', '=', 'sent')]"/>
|
||||
<filter string="Received" name="filter_received"
|
||||
domain="[('state', '=', 'received')]"/>
|
||||
<filter string="Failed" name="filter_failed"
|
||||
domain="[('state', '=', 'failed')]"/>
|
||||
<separator/>
|
||||
<filter string="My Faxes" name="filter_my_faxes"
|
||||
domain="[('sent_by_id', '=', uid)]"/>
|
||||
<separator/>
|
||||
<filter string="Direction" name="group_direction"
|
||||
context="{'group_by': 'direction'}"/>
|
||||
<filter string="Status" name="group_state"
|
||||
context="{'group_by': 'state'}"/>
|
||||
<filter string="Recipient" name="group_partner"
|
||||
context="{'group_by': 'partner_id'}"/>
|
||||
<filter string="Sent Date" name="group_date"
|
||||
context="{'group_by': 'sent_date:month'}"/>
|
||||
<filter string="Sent By" name="group_user"
|
||||
context="{'group_by': 'sent_by_id'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menu and Actions -->
|
||||
<record id="action_fusion_fax" model="ir.actions.act_window">
|
||||
<field name="name">All Faxes</field>
|
||||
<field name="res_model">fusion.fax</field>
|
||||
<field name="path">faxes</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" ref="view_fusion_fax_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No faxes yet
|
||||
</p>
|
||||
<p>
|
||||
Send faxes from Sale Orders or Invoices using the "Send Fax" button,
|
||||
or create one manually from here.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Received Faxes Action -->
|
||||
<record id="action_fusion_fax_received" model="ir.actions.act_window">
|
||||
<field name="name">Received Faxes</field>
|
||||
<field name="res_model">fusion.fax</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="domain">[('direction', '=', 'inbound')]</field>
|
||||
<field name="search_view_id" ref="view_fusion_fax_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No received faxes yet
|
||||
</p>
|
||||
<p>
|
||||
Incoming faxes are automatically synced from RingCentral every 5 minutes.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sent Faxes Action -->
|
||||
<record id="action_fusion_fax_sent" model="ir.actions.act_window">
|
||||
<field name="name">Sent Faxes</field>
|
||||
<field name="res_model">fusion.fax</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="domain">[('direction', '=', 'outbound')]</field>
|
||||
<field name="search_view_id" ref="view_fusion_fax_search"/>
|
||||
</record>
|
||||
|
||||
<!-- Top-level Faxes menu -->
|
||||
<menuitem id="menu_fusion_faxes_root"
|
||||
name="Faxes"
|
||||
web_icon="fusion_faxes,static/description/icon.png"
|
||||
sequence="45"/>
|
||||
|
||||
<menuitem id="menu_fusion_fax_list"
|
||||
name="All Faxes"
|
||||
parent="menu_fusion_faxes_root"
|
||||
action="action_fusion_fax"
|
||||
sequence="10"/>
|
||||
|
||||
<menuitem id="menu_fusion_fax_received"
|
||||
name="Received Faxes"
|
||||
parent="menu_fusion_faxes_root"
|
||||
action="action_fusion_fax_received"
|
||||
sequence="15"/>
|
||||
|
||||
<menuitem id="menu_fusion_fax_sent"
|
||||
name="Sent Faxes"
|
||||
parent="menu_fusion_faxes_root"
|
||||
action="action_fusion_fax_sent"
|
||||
sequence="20"/>
|
||||
|
||||
</odoo>
|
||||
115
fusion_faxes/views/res_config_settings_views.xml
Normal file
115
fusion_faxes/views/res_config_settings_views.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_config_settings_view_form_fusion_faxes" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.fusion_faxes</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form" position="inside">
|
||||
<app data-string="Fusion Faxes" string="Fusion Faxes" name="fusion_faxes"
|
||||
groups="fusion_faxes.group_fax_manager">
|
||||
|
||||
<h2>RingCentral Configuration</h2>
|
||||
<div class="row mt-4 o_settings_container">
|
||||
|
||||
<!-- Enable toggle -->
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="ff_ringcentral_enabled"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="ff_ringcentral_enabled"/>
|
||||
<div class="text-muted">
|
||||
Enable sending faxes via RingCentral API.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Server URL -->
|
||||
<div class="col-12 col-lg-6 o_setting_box"
|
||||
invisible="not ff_ringcentral_enabled">
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">Server URL</span>
|
||||
<div class="text-muted">
|
||||
RingCentral API server URL. Use https://platform.devtest.ringcentral.com for sandbox.
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<field name="ff_ringcentral_server_url"
|
||||
placeholder="https://platform.ringcentral.com"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Client ID -->
|
||||
<div class="col-12 col-lg-6 o_setting_box"
|
||||
invisible="not ff_ringcentral_enabled">
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">Client ID</span>
|
||||
<div class="text-muted">
|
||||
From your RingCentral Developer Console app.
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<field name="ff_ringcentral_client_id"
|
||||
placeholder="Enter Client ID..."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Client Secret -->
|
||||
<div class="col-12 col-lg-6 o_setting_box"
|
||||
invisible="not ff_ringcentral_enabled">
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">Client Secret</span>
|
||||
<div class="text-muted">
|
||||
From your RingCentral Developer Console app.
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<field name="ff_ringcentral_client_secret"
|
||||
password="True"
|
||||
placeholder="Enter Client Secret..."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- JWT Token -->
|
||||
<div class="col-12 col-lg-6 o_setting_box"
|
||||
invisible="not ff_ringcentral_enabled">
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">JWT Token</span>
|
||||
<div class="text-muted">
|
||||
Generated from RingCentral Developer Console > Credentials > JWT.
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<field name="ff_ringcentral_jwt_token"
|
||||
password="True"
|
||||
placeholder="Enter JWT Token..."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Test Connection button -->
|
||||
<div class="col-12 col-lg-6 o_setting_box"
|
||||
invisible="not ff_ringcentral_enabled">
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">Test Connection</span>
|
||||
<div class="text-muted">
|
||||
Verify your RingCentral credentials are working.
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button name="action_test_ringcentral_connection"
|
||||
string="Test Connection"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
icon="fa-plug"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</app>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
47
fusion_faxes/views/res_partner_views.xml
Normal file
47
fusion_faxes/views/res_partner_views.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Add fax number field + fax history tab to contact form -->
|
||||
<record id="view_partner_form_inherit_fusion_faxes" model="ir.ui.view">
|
||||
<field name="name">res.partner.form.inherit.fusion_faxes</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Add fax number after phone field -->
|
||||
<xpath expr="//field[@name='phone']" position="after">
|
||||
<field name="x_ff_fax_number" placeholder="Fax number..."/>
|
||||
</xpath>
|
||||
|
||||
<!-- Add smart button for fax count -->
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_faxes" type="object"
|
||||
class="oe_stat_button" icon="fa-fax"
|
||||
invisible="x_ff_fax_count == 0">
|
||||
<field name="x_ff_fax_count" widget="statinfo" string="Faxes"/>
|
||||
</button>
|
||||
</xpath>
|
||||
|
||||
<!-- Add Fax History tab -->
|
||||
<xpath expr="//page[@name='internal_notes']" position="after">
|
||||
<page string="Fax History" name="fax_history"
|
||||
invisible="x_ff_fax_count == 0">
|
||||
<field name="x_ff_fax_ids" readonly="1">
|
||||
<list>
|
||||
<field name="name"/>
|
||||
<field name="sent_date"/>
|
||||
<field name="fax_number"/>
|
||||
<field name="page_count"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-success="state == 'sent'"
|
||||
decoration-danger="state == 'failed'"/>
|
||||
<field name="sent_by_id"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
31
fusion_faxes/views/sale_order_views.xml
Normal file
31
fusion_faxes/views/sale_order_views.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Add Send Fax button + smart button to sale order form -->
|
||||
<record id="view_sale_order_form_inherit_fusion_faxes" model="ir.ui.view">
|
||||
<field name="name">sale.order.form.inherit.fusion_faxes</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Smart button for fax count -->
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_faxes" type="object"
|
||||
class="oe_stat_button" icon="fa-fax"
|
||||
invisible="x_ff_fax_count == 0">
|
||||
<field name="x_ff_fax_count" widget="statinfo" string="Faxes"/>
|
||||
</button>
|
||||
</xpath>
|
||||
|
||||
<!-- Send Fax header button -->
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="action_send_fax" string="Send Fax"
|
||||
type="object" class="btn-secondary"
|
||||
icon="fa-fax"
|
||||
groups="fusion_faxes.group_fax_user"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user