Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consulting
    • Accounting Firm
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Solar Energy Systems
    • Shoe Maker
    • Serveis de neteja
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to Hide Cost Price and Sale Price for Users in Inventory and Manufacturing(Odoo 18 Community)

Subscriure's

Get notified when there's activity on this post

This question has been flagged
manufacturinginventory
3 Respostes
4902 Vistes
Avatar
ACTION CHIM

Hello,

I am using Odoo 18 Community Edition and I want to restrict certain users from viewing the cost price and sale price in the Inventory and Manufacturing modules. Is there a way to achieve this using access rights or record rules?


Thanks in advance

1
Avatar
Descartar
ACTION CHIM
Autor

Thanks for your answer! I am new to Odoo. Could you please provide a step-by-step guide on how to implement this?

Chris TRINGHAM

You can search for more detailed answers, but you need to understand how Odoo works and that is beyond the scope of a Help question and answer (in my opinion). I did write one more detailed answer a while back (https://www.odoo.com/forum/help-1/re-how-to-disable-update-cost-on-sales-user-176326/#answer-176326) and there is some useful information on my website http://odootricks.tips/

Avatar
Chris TRINGHAM
Best Answer

Yes, you can limit access based on User Access Groups, something like this (in an Extension View):

<data>
  <xpath expr="//field[@name='order_line']" position="attributes">
    <attribute name="groups">base.group_erp_manager</attribute>
  </xpath>

</data>
0
Avatar
Descartar
Avatar
ACTION CHIM
Autor Best Answer

Thanks guys for the help, I found a free app to hide cost price by Cybrosys Techno Solutions
for the sale price I have tried to do the same thing but it did not work here is the code and the error I am getting if someone can help:

/security/hide_sell_price_groups.xml

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <data>

        <!-- Access to the sell price -->

        <record id="groups_view_sell_price" model="res.groups">

            <field name="name">View Sell Price</field>

            <field name="users" eval="[Command.link(ref('base.user_root')), Command.link(ref('base.user_admin'))]"/>

        </record>

    </data>

</odoo>

/views/product_product_views.xml

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <!-- Product Variant Form View -->

    <record id="product_normal_form_view" model="ir.ui.view">

        <field name="name">product.product.view.form.inherited.hide.sell.price</field>

        <field name="model">product.product</field>

        <field name="inherit_id" ref="product.product_normal_form_view"/>

        <field name="arch" type="xml">

            <field name="lst_price" position="attributes">

                <attribute name="groups">hide_sell_price.groups_view_sell_price</attribute>

            </field>

        </field>

    </record>

    <!-- Product Variant Tree View -->

    <record id="product_product_tree_view" model="ir.ui.view">

        <field name="name">product.product.view.tree.inherited.hide.sell.price</field>

        <field name="model">product.product</field>

        <field name="inherit_id" ref="product.product_product_tree_view"/>

        <field name="arch" type="xml">

            <field name="lst_price" position="attributes">

                <attribute name="groups">hide_sell_price.groups_view_sell_price</attribute>

            </field>

        </field>

    </record>

    <record id="product_variant_easy_edit_view" model="ir.ui.view">

        <field name="name">product.product.view.tree.inherited.hide.sell.price</field>

        <field name="model">product.product</field>

        <field name="inherit_id" ref="product.product_variant_easy_edit_view"/>

        <field name="arch" type="xml">

            <field name="lst_price" position="attributes">

                <attribute name="groups">hide_sell_price.groups_view_sell_price</attribute>

            </field>

        </field>

    </record>

</odoo>

/views/product_template_views.xml

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <!-- Product Template Form View -->

    <record id="product_template_form_view" model="ir.ui.view">

        <field name="name">product.template.view.form.inherit.hide.sell.price</field>

        <field name="model">product.template</field>

        <field name="inherit_id" ref="product.product_template_form_view"/>

        <field name="arch" type="xml">

            <field name="lst_price" position="attributes">

                <attribute name="groups">hide_sell_price.groups_view_sell_price</attribute>

            </field>

        </field>

    </record>

    <!-- Product Template Tree View -->

    <record id="product_template_tree_view" model="ir.ui.view">

        <field name="name">product.template.view.tree.inherit.hide.sell.price</field>

        <field name="model">product.template</field>

        <field name="inherit_id" ref="product.product_template_tree_view"/>

        <field name="arch" type="xml">

            <field name="lst_price" position="attributes">

                <attribute name="groups">hide_sell_price.groups_view_sell_price</attribute>

            </field>

        </field>

    </record>

</odoo>

and here is the error

odoo.tools.convert.ParseError: while parsing /home/odoo/odoo18/custom_addons/hide_sell_price/views/product_template_views.xml:4

Error during parsing or validation of the view:

The element <field name="lst_price"> cannot be located in the parent view


{

  "file": "/home/odoo/odoo18/custom_addons/hide_sell_price/views/product_template_views.xml",

  "line": 1,

  "name": "product.template.view.form.inherit.hide.sell.price",

  "view": ir.ui.view(3570,),

  "view.model": "product.template",

  "view.parent": ir.ui.view(470,),

  "xmlid": "product_template_form_view"

}

0
Avatar
Descartar
Avatar
Lars Aam
Best Answer

If you have the Studio app installed (extra cost): 

Open the view with fields you want to restrict access.  Open studio.  There click on the field.  On the left side down, you will see 'Limit Visibility to fields'.  Careful, you can mess up.  I recommend you know the basics on managing access rights.

The result is a code like described by Chris.

The studio app then adds an extension view that is inherited in the basic view.   You avoid modifying Odoo standard code.

Studio app is excellent for those that do not know coding. But comes with a warning: You can mess up, and this might not work after updated version.

0
Avatar
Descartar
Chris TRINGHAM

Thanks Lars - that's how I created the Extension View in my answer, but the question was about Community Edition so that's not an option :-)

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Blank BoM not sending MO to draft Solved
manufacturing inventory
Avatar
Avatar
Avatar
Avatar
3
de set. 25
2266
Creating many manufactured products with serial numbers Solved
manufacturing inventory
Avatar
Avatar
2
d’ag. 25
8601
Compute Theoretical Stock level for manufactured product from components
manufacturing inventory
Avatar
0
de nov. 24
1930
Reservation stock going to not available while there is stock
manufacturing inventory
Avatar
1
d’oct. 24
2219
Sales Management for Manufactured Items Tracked by Serial Number
manufacturing inventory
Avatar
Avatar
1
de març 24
1894
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now