Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
manufacturinginventory
3 Respuestas
4908 Vistas
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
Mejor respuesta

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 Mejor respuesta

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
Mejor respuesta

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 :-)

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Blank BoM not sending MO to draft Resuelto
manufacturing inventory
Avatar
Avatar
Avatar
Avatar
3
sept 25
2267
Creating many manufactured products with serial numbers Resuelto
manufacturing inventory
Avatar
Avatar
2
ago 25
8601
Compute Theoretical Stock level for manufactured product from components
manufacturing inventory
Avatar
0
nov 24
1931
Reservation stock going to not available while there is stock
manufacturing inventory
Avatar
1
oct 24
2220
Sales Management for Manufactured Items Tracked by Serial Number
manufacturing inventory
Avatar
Avatar
1
mar 24
1896
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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