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 disable CSV import for certain users?

Suscribirse

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

Se marcó esta pregunta
v8importcsvrestrict
5 Respuestas
12646 Vistas
Avatar
Alejandro Santana

I need to make CSV import option (for all models) only available to certain security groups in Odoo v8.

How to do that? Any hint?


--- UPDATE ---

So far:

I have created a specific security group and category for CSV import.

A) No security rules

I cannot create security rules over TransientModels (Why? Whyyyy?), therefore I cannot use this over base_import.import model. (Damn! That would have been easy for once!)


B) No xml "groups" allowed for non-visual elements

In addons/base_import/views/base_import.xml there are these lines:

<template id="assets_backend" name="base_import assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/base_import/static/src/css/import.css"/>
<script type="text/javascript" src="/base_import/static/lib/javascript-state-machine/state-machine.js"></script>
<script type="text/javascript" src="/base_import/static/src/js/import.js"></script>
</xpath>
</template>

But, even I can modify that xpaths and avoid those link and 2 scripts, I cannot make it group-based optional using "groups" attribute, as it is completely ignored (Does "groups" only apply to visual elements like fields, divs, groups and so?)


C) Is it even possible to check groups with t-if? No clue how.

In addons/base_import/static/src/xml/import.xml there are these lines:

    <t t-extend="ListView.buttons">
    <t t-jquery="span.oe_alternative">
        this.attr('t-if', 'widget.options.import_enabled');
    </t>
    <t t-jquery="span.oe_alternative" t-operation="append">
        <a href="#" class="oe_bold oe_list_button_import">Import</a>
    </t>
</t>

But once again, I have no clue how to add a t-if for that "a href" checking if current user belongs to a specific group I have created for csv import.

Documentation says nothing about hot to check it in QWeb views.


D) JS? Really?

Haven't even tried it. Should be easier.

 

1
Avatar
Descartar
Cyril Gaspard (GEM)

did you try to override functionlike def do, in base_import module, file models.py, by testing if the user is in your group and if not, do a raise ?

Alejandro Santana
Autor

I would like to directly disable any possibility of accesing import by hiding/removing the button. But if everything else fails, I would go there.

Avatar
Alejandro Santana
Autor Mejor respuesta

I solved it with javascript. I made a pull request in github with a new module called "import_csv_restrict": https://github.com/OCA/server-tools/pull/154

1
Avatar
Descartar
Aslam Up

how can i get this module ?

Avatar
Mohammed Rida Yahla
Mejor respuesta

the best solution for this is simple, just a configuration trick :

  1. go to Configuration (make sure your admin user have access to Technical settings)

  2. go to user interface / views

  3. search for base_import assets

  4. go to Group page, then add the admin group.     
    then refresh the user then the import button is gone (y)
    PS : i tried this using odoo V8

1
Avatar
Descartar
Gary Walters

On v10, I get a Validation Error when trying to Save after adding the group.

"Qweb view cannot have 'Groups' define on the record. Use 'groups' attributes inside the view definition"

Mohammed Rida Yahla

this solution tested only with odoo 8

¿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
CSV import : how not to update a record's field ?
v8 import csv
Avatar
Avatar
Avatar
5
jul 20
7796
Does CSV import allow multilanguage?
v8 import csv multilanguage
Avatar
Avatar
1
mar 15
5847
Disable automatic follow when importing res.partner csv
import csv
Avatar
Avatar
Avatar
3
jun 20
5009
Enable/disable import rights?
import csv
Avatar
Avatar
1
nov 18
10486
'utf8' codec can't decode byte error when importing a list of products as a CSV file Resuelto
import csv
Avatar
Avatar
Avatar
Avatar
Avatar
11
feb 17
65063
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.

Sitio web hecho con

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