fix: comprehensive permission overhaul for fusion_faxes and fusion_ringcentral
Users without fax/RC groups could not open Sale Orders, Invoices, or Contacts because the One2many computed fields triggered AccessError on fusion.fax. Now base.group_user gets read-only access so computed fields work silently, while all UI elements (smart buttons, header buttons, menus, partner fields, settings) are restricted to the proper security groups. Both modules now use Odoo 19 privilege pattern for the user settings dropdown. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_rc_config_manager,rc.config.manager,model_rc_config,group_rc_manager,1,1,1,1
|
||||
access_rc_call_history_base,rc.call.history.base.read,model_rc_call_history,base.group_user,1,0,0,0
|
||||
access_rc_call_history_user,rc.call.history.user,model_rc_call_history,group_rc_user,1,1,1,0
|
||||
access_rc_call_history_company,rc.call.history.company,model_rc_call_history,group_rc_company_user,1,1,1,0
|
||||
access_rc_call_history_manager,rc.call.history.manager,model_rc_call_history,group_rc_manager,1,1,1,1
|
||||
access_rc_call_dashboard_user,rc.call.dashboard.user,model_rc_call_dashboard,group_rc_user,1,1,1,1
|
||||
access_rc_voicemail_base,rc.voicemail.base.read,model_rc_voicemail,base.group_user,1,0,0,0
|
||||
access_rc_voicemail_user,rc.voicemail.user,model_rc_voicemail,group_rc_user,1,1,1,0
|
||||
access_rc_voicemail_company,rc.voicemail.company,model_rc_voicemail,group_rc_company_user,1,1,1,0
|
||||
access_rc_voicemail_manager,rc.voicemail.manager,model_rc_voicemail,group_rc_manager,1,1,1,1
|
||||
|
||||
|
@@ -50,6 +50,33 @@
|
||||
|
||||
<data noupdate="0">
|
||||
|
||||
<!-- ============================================================ -->
|
||||
<!-- Base read rules (allow computed fields on res.partner to -->
|
||||
<!-- work for users without RC groups) -->
|
||||
<!-- ============================================================ -->
|
||||
|
||||
<record id="rule_call_base_read" model="ir.rule">
|
||||
<field name="name">RC Call: all internal users read-only</field>
|
||||
<field name="model_id" ref="model_rc_call_history"/>
|
||||
<field name="domain_force">[(1, '=', 1)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="rule_voicemail_base_read" model="ir.rule">
|
||||
<field name="name">RC Voicemail: all internal users read-only</field>
|
||||
<field name="model_id" ref="model_rc_voicemail"/>
|
||||
<field name="domain_force">[(1, '=', 1)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- ============================================================ -->
|
||||
<!-- Call History record rules -->
|
||||
<!-- ============================================================ -->
|
||||
|
||||
@@ -8,34 +8,39 @@
|
||||
<field name="inherit_id" ref="fusion_faxes.view_fusion_fax_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Add Forward and Send New buttons to header -->
|
||||
<!-- Add Forward and Send New buttons to header (RC users only) -->
|
||||
<xpath expr="//button[@name='action_resend']" position="after">
|
||||
<button name="action_forward_fax" string="Forward Fax"
|
||||
type="object" class="btn-secondary"
|
||||
icon="fa-share"
|
||||
invisible="direction != 'inbound' or state != 'received'"/>
|
||||
invisible="direction != 'inbound' or state != 'received'"
|
||||
groups="fusion_ringcentral.group_rc_user"/>
|
||||
<button name="action_send_new_fax" string="Send New Fax"
|
||||
type="object" class="btn-secondary"
|
||||
icon="fa-fax"/>
|
||||
icon="fa-fax"
|
||||
groups="fusion_ringcentral.group_rc_user"/>
|
||||
</xpath>
|
||||
|
||||
<!-- Add Contact, Sales Orders, Invoices smart buttons -->
|
||||
<!-- Add Contact, Sales Orders, Invoices smart buttons (RC users only) -->
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_contact" type="object"
|
||||
class="oe_stat_button" icon="fa-user"
|
||||
invisible="not partner_id">
|
||||
invisible="not partner_id"
|
||||
groups="fusion_ringcentral.group_rc_user">
|
||||
<div class="o_stat_info">
|
||||
<span class="o_stat_text"><field name="partner_id" readonly="1" nolabel="1" class="o_text_overflow"/></span>
|
||||
</div>
|
||||
</button>
|
||||
<button name="action_view_sale_orders" type="object"
|
||||
class="oe_stat_button" icon="fa-shopping-cart"
|
||||
invisible="not partner_id">
|
||||
invisible="not partner_id"
|
||||
groups="fusion_ringcentral.group_rc_user">
|
||||
<field name="sale_order_count" widget="statinfo" string="Sales Orders"/>
|
||||
</button>
|
||||
<button name="action_view_invoices" type="object"
|
||||
class="oe_stat_button" icon="fa-file-text-o"
|
||||
invisible="not partner_id">
|
||||
invisible="not partner_id"
|
||||
groups="fusion_ringcentral.group_rc_user">
|
||||
<field name="invoice_count" widget="statinfo" string="Invoices"/>
|
||||
</button>
|
||||
</xpath>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
<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 RingCentral" string="Fusion RingCentral" name="fusion_ringcentral">
|
||||
<app data-string="Fusion RingCentral" string="Fusion RingCentral" name="fusion_ringcentral"
|
||||
groups="fusion_ringcentral.group_rc_manager">
|
||||
<h2>AI Transcription</h2>
|
||||
<div class="row mt-4 o_settings_container">
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
|
||||
@@ -8,19 +8,21 @@
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Smart button for call count -->
|
||||
<!-- Smart button for call count (RC users only) -->
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_rc_calls" type="object"
|
||||
class="oe_stat_button" icon="fa-phone"
|
||||
invisible="rc_call_count == 0">
|
||||
invisible="rc_call_count == 0"
|
||||
groups="fusion_ringcentral.group_rc_user">
|
||||
<field name="rc_call_count" widget="statinfo" string="Calls"/>
|
||||
</button>
|
||||
</xpath>
|
||||
|
||||
<!-- RingCentral Calls tab -->
|
||||
<!-- RingCentral Calls tab (RC users only) -->
|
||||
<xpath expr="//page[@name='internal_notes']" position="after">
|
||||
<page string="RingCentral Calls" name="rc_calls"
|
||||
invisible="rc_call_count == 0">
|
||||
invisible="rc_call_count == 0"
|
||||
groups="fusion_ringcentral.group_rc_user">
|
||||
<field name="rc_call_ids" readonly="1">
|
||||
<list decoration-danger="status in ('missed', 'no_answer')"
|
||||
decoration-success="status == 'answered'">
|
||||
|
||||
Reference in New Issue
Block a user