Skip to content
Snippets Groups Projects
Commit 4b899e50 authored by dht-odoo's avatar dht-odoo
Browse files

[FIX] sale: allow internal users to access UTM campaings


Before this commit:
UTM campaigns are accessible to all internal users. But with sale module
installed, few of the fields are added into the `utm.campaign` model and
it's views. Those fields contain information related to quotations and
invoices. So if the internal user who does not have the basic sales rights
tries to access the campaing, an AccessError is raised.

With this commit:
We only show those fields in the views to the users having enough rights
("sales_team.group_sale_salesman") and thus allow other internal users
to access the UTM campaings without AccessError.

Task-2417993

closes odoo/odoo#73338

Related: odoo/enterprise#19487
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 05fedd20
Branches
Tags
No related merge requests found
......@@ -6,13 +6,13 @@
<field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='utm_statistics']" position="inside">
<div class="mr-3" title="Revenues">
<div class="mr-3" title="Revenues" groups="sales_team.group_sale_salesman">
<field name="currency_id" invisible="True"/>
<small class="font-weight-bold">
<field name="invoiced_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</small>
</div>
<div class="mr-3" title="Quotations">
<div class="mr-3" title="Quotations" groups="sales_team.group_sale_salesman">
<i class="fa fa-money text-muted"></i>
<small class="font-weight-bold">
<field name="quotation_count"/>
......@@ -29,11 +29,11 @@
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="action_redirect_to_invoiced"
type="object" class="oe_stat_button order-1" icon="fa-usd">
type="object" class="oe_stat_button order-1" icon="fa-usd" groups="sales_team.group_sale_salesman">
<field name="invoiced_amount" widget="statinfo" string="Revenues"/>
</button>
<button name="action_redirect_to_quotations"
type="object" class="oe_stat_button order-2" icon="fa-money">
type="object" class="oe_stat_button order-2" icon="fa-money" groups="sales_team.group_sale_salesman">
<field name="quotation_count" widget="statinfo" string="Quotations"/>
</button>
</xpath>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment