Skip to content
DevMarket
Odoo ModulesWordPress PluginsWordPress ThemesShopify ThemesApp TemplatesScripts & UtilitiesBlogSell on DevMarket

Hide Product Cost & Margins from Salespersons for Odoo 19 documentation

A guide to hiding product cost and margins from salespersons: what disappears, who still sees it, how the API is protected, and what the module does not cover.

Documents version 1.0.1Updated Oct 23, 2026

Start here

In plain words: Odoo shows the product Cost and the order Margin to every internal user. That is fine for a manager, but a salesperson who sees that you buy a chair for 55 and sell it for 70 negotiates differently, and may tell a customer. This module takes cost and margin away from the people you choose, everywhere: in the screens, in the reports, and in the API.
A salesperson's order: prices, quantities and totals. No cost, no margin.
A salesperson's order: prices, quantities and totals. No cost, no margin.
SalespersonSales manager, accountant, administrator
Product form and listsNo CostCost shown
Order linesNo Cost, Margin, Margin % columnsOptional columns available
Order totalsNo margin lineMargin and percentage
Sales and invoice analysisNo Margin measureMargin available
JSON-RPC / XML-RPC / exportsAccess deniedAllowed
Tip: Salespersons keep working exactly as before: they quote, confirm, deliver and invoice. Odoo still computes the margin in the background for the people who may see it.

What is hidden

ModelFieldWhere you see it normally
Product / Product templateCost (standard_price)Product form, product list, variants list
Sales order lineCost (purchase_price), Margin, Margin %Order lines (form and list), pivot and graph
Sales orderMargin, Margin %Totals of the order, orders list, pivot and graph
Sales analysis reportMarginSales → Reporting → Sales
Invoice analysis reportMargin, Inventory valueInvoicing → Reporting → Invoices
In plain words: These are the fields Odoo itself uses to show or compute cost and margin. The module does not hide anything else: prices, discounts, taxes and totals stay visible.

Requirements

ItemDetails
Odoo19.0 (Community or Enterprise)
Apps neededSales with the Margins in Sales Orders module (sale_margin), Invoicing and Inventory. They are installed for you.
LicenseOPL-1 (Odoo Proprietary License v1.0)

Install

  1. Unzip the package. Inside is taqnix_hide_cost_margin.zip; unzip it to get the folder taqnix_hide_cost_margin.
  2. Copy the folder into one of the addons_path folders of your Odoo server and restart Odoo.
  3. Log in as an administrator, activate Developer mode, open Apps and press Update Apps List.
  4. Remove the “Apps” filter, search Hide Product Cost and press Install.
# or from the command line
./odoo-bin -c odoo.conf -d YOUR_DATABASE -i taqnix_hide_cost_margin --stop-after-init
Important: Installing the module hides cost and margin from everybody who is not in the group below. Check chapter 5 before you install on a live system, so nobody who needs cost loses it.

Who still sees cost and margin

In plain words: One group decides: See Product Cost & Margins. It is given automatically, through the roles Odoo already has, to the people who normally work with costs.
Role in OdooSees cost and margin?
Sales → Administrator (sales manager)Yes
Accounting → Accountant and AdviserYes
Inventory → AdministratorYes
Purchase → User and AdministratorYes
Settings → AdministratorYes
Sales → User: Own Documents OnlyNo
Sales → User: All DocumentsNo
Accounting → Billing onlyNo
Settings → Users & Companies → Groups (Developer mode): the group and everyone who has it.
Settings → Users & Companies → Groups (Developer mode): the group and everyone who has it.
  1. Open Settings → Users & Companies → Users and open the user.
  2. To give cost visibility, add the group See Product Cost & Margins in the user's access rights, or give the user one of the roles above.
  3. To take it away, remove the role that grants it. Whoever has no such role simply stops seeing the figures.
Tip: Because the group comes from roles, nobody has to be edited one by one: existing managers and accountants keep seeing everything the moment you install, salespersons lose it.

On the product

In plain words: The product form is the first place people look. The same product, seen by a salesperson and by a manager:
A salesperson: the Cost field is simply not there.
A salesperson: the Cost field is simply not there.
A manager: Cost sits under Sales Price.
A manager: Cost sits under Sales Price.
In plain words: The product list and the variants list lose their Cost column too.

On sales orders

In plain words: On an order the module removes the Cost, Margin and Margin % columns, the margin line under the totals and the optional-column choices.
A manager can switch the Cost and Margin columns on from the column menu.
A manager can switch the Cost and Margin columns on from the column menu.
For a salesperson the same menu has no Cost and no Margin.
For a salesperson the same menu has no Cost and no Margin.
The manager's order with Cost, Margin and the margin line under the totals.
The manager's order with Cost, Margin and the margin line under the totals.
In plain words: Salespersons can still change quantities, prices and discounts. If a price is changed, the margin is updated in the background; only people in the group can see it.

In the reports

In plain words: Reports are where margin usually leaks. The module removes the Margin measure from the sales analysis, and the Margin and Inventory value measures from the invoice analysis, for people outside the group.
A manager can choose Margin as a measure.
A manager can choose Margin as a measure.
For a salesperson the list of measures has no Margin.
For a salesperson the list of measures has no Margin.
In plain words: The same applies to filters, grouping and exports: a field that cannot be read cannot be put in a filter, a group-by or an Excel export either.

Not only the screen: the API

In plain words: Hiding a field in a view is not enough. Odoo has an open API, and a curious employee with a few lines of Python can ask the server directly for the cost of every product. This module works on the model itself, so the server refuses.
The same JSON-RPC calls, one by a salesperson (refused) and one by a manager (answered).
The same JSON-RPC calls, one by a salesperson (refused) and one by a manager (answered).
import xmlrpc.client
common = xmlrpc.client.ServerProxy('https://erp.example.com/xmlrpc/2/common')
uid = common.authenticate('db', 'sally', 'her-password', {})
m = xmlrpc.client.ServerProxy('https://erp.example.com/xmlrpc/2/object')

m.execute_kw('db', uid, 'her-password', 'product.template', 'read', [[3], ['name']])
# [{'id': 3, 'name': 'Virtual Interior Design'}]

m.execute_kw('db', uid, 'her-password', 'product.template', 'read', [[3], ['standard_price']])
# xmlrpc.client.Fault: AccessError: You do not have enough rights to access the field "standard_price"
Call by a salespersonResult
read with the hidden fieldAccess error
read without a field listWorks, but the hidden fields are not in the answer
search / search_read with a domain on a hidden fieldAccess error (no guessing the cost by filtering)
read_group on a hidden fieldAccess error
write of the costAccess error
fields_getHidden fields are not announced

What it does not hide

In plain words: Be clear about the limits so there are no surprises.
Not coveredWhat to do
Vendor prices on the product's Purchase tab, purchase ordersThese need the Purchase app. Do not give it to salespersons.
Stock valuation, inventory value reportsThese need Inventory rights. Do not give them to salespersons.
Manufacturing cost (bills of materials, work centres)Needs Manufacturing rights.
Point of Sale margin reportsPoint of Sale has its own reports. Keep them to managers.
Custom modules that read the cost for a salespersonThey will get an access error. See chapter 12 for the fix.
The selling price and the discountsThese are not secrets: salespersons need them to sell.
Important: If a salesperson also has Purchase, Inventory or Point of Sale manager rights, those apps show costs through their own screens. Review the roles of your sales team.

Try it yourself

  1. Create a test user with only Sales → User: All Documents (plus Invoicing if they should invoice).
  2. Open a private browser window and log in as that user.
  3. Open a product, an order and Sales → Reporting. There should be no Cost, no Margin.
  4. Create a quotation, confirm it and create an invoice. Everything works as before.
  5. Log in as a manager and check the margin of that order: it is there and correct.
In plain words: The module comes with automated tests that do exactly this, including the API calls shown in chapter 9.

For developers

In plain words: Skip this chapter if you only use the module.
ItemDetails
Grouptaqnix_hide_cost_margin.group_see_cost
How fields are protectedThe fields are re-declared with groups. Odoo then refuses to read, search, group, write and export them for others, and removes them from every view.
Your own codeRead protected fields with .sudo() when your code must use them for any user.
Order lines_add_precomputed_values runs as superuser so the cost can be precomputed when a salesperson creates a line.
# protect another field the same way
from odoo import fields, models

class ProductTemplate(models.Model):
    _inherit = 'product.template'

    my_secret_price = fields.Float(groups='taqnix_hide_cost_margin.group_see_cost')

# your own code that needs the cost for any user
cost = line.product_id.sudo().standard_price

Troubleshooting

ProblemWhat to do
A salesperson still sees the costThey have a role that grants the group (for example Sales Administrator or Purchase User). Check the user's roles and remove the one that is too much.
A manager no longer sees the marginThe manager is missing the group. Give the user the Sales Administrator role or add the group directly.
A custom report or module fails with an access error for salespersonsIt reads the cost as that user. Make it use .sudo() for the cost, or give the user the group.
The Cost column is still in my list after installingReload the page with Ctrl+Shift+R.
Margins are missing on old ordersNothing was lost: they are stored. Only users in the group can read them.

Updating and removing

Replace the folder with the new version, restart Odoo and run -u taqnix_hide_cost_margin. To remove it, uninstall it from Apps: cost and margin become visible to all internal users again, as in standard Odoo. No data is changed or lost.

Support

Installation help and bug fixes are included for 6 months, with lifetime updates. Contact us through the marketplace page where you bought the module or write to support@taqnix.com with your Odoo version and a screenshot.