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

Restrict vendor and product creation in V17

Suscribirse

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

Se marcó esta pregunta
accessrightsvendorstudio
3 Respuestas
4949 Vistas
Avatar
dhivya.n@galileosolutionpartners.com

How to restrict vendor creation without affecting customer in odoo 17 ? from all he forms. 
Please advice, if i remove create access in res.partner object. Can't allowing to create customer  also. Without affecting customer part I want to restrict vendor creation. 


I want to restrict product creation by access rights or using studio, without touching the coding part

0
Avatar
Descartar
Avatar
Vinsinfo Pvt Ltd
Mejor respuesta

Hi,


You can restrict vendor creation without affecting customer creation in Odoo by following these steps:


1. Go to Settings and enable Developer Mode.

2. Create a new group in Settings > Users & Companies > Groups > New. Add all the users to whom you want to give create access, and select all the access rights for that group.

3. Create a new record rule in Settings > Technical > Record Rules under the Security section with the configuration below:

Domain filter: Ensure to include the group ID (116 in this example) that we created earlier.

4. Now, only the users in the newly created group can create a vendor.

5. After these configurations, non-access members may still be able to create a vendor (who are typically not vendors) as a contact in the Product template purchase tab. To prevent this, restrict the "Create" and "Create/Edit" permissions for all users using the Studio application.


Click Studio icon from the product template page and click on purchase tab and select Edit list view.


After that click "Vendor" on the list view and check the highlighted checkboxes on the left side of the screen and save the changes.



Hope this helps.


Thanks.

1
Avatar
Descartar
dhivya.n@galileosolutionpartners.com
Autor

When I try to save this record rule getting this warning "Invalid domain: not enough values to unpack (expected 3, got 1)"

['I', ('supplier_rank', '=',0), ('create_uid.groups_id', 'in', [226])]

Vinsinfo Pvt Ltd

In the domain filter, you wrongly placed 'I' instead of '|'. That's why the warning is raised. Replace it with ['|', ('supplier_rank', '=', 0), ('create_uid.groups_id', 'in', [226])] and it will work fine.

dhivya.n@galileosolutionpartners.com
Autor

Yes, it is works fine to restrict vendor creation. Can I restrict product creation by this way?

Avatar
dhivya.n@galileosolutionpartners.com
Autor Mejor respuesta

Without touching the coding part I want to restrict. From the front end edit form view or studio or using access rights group.

0
Avatar
Descartar
Vinsinfo Pvt Ltd

Replace the domain filter with ['|', ('supplier_rank', '=',0), ('create_uid.groups_id', 'in', [226])]

Avatar
Jainesh Shah(Aktiv Software)
Mejor respuesta

Hello dhivya.n@galileosolutionpartners.com,


To restrict the creation of vendors in Odoo 17 while allowing customers to be created, follow these refined steps to implement a comprehensive solution:



1. if you want to remove create access for specific vendor view for same res.partner obj ,you can manage by this in res.partner you can use get_view method.

//Code1 in Comment//

by this contact creation is not restricted, only vendor creation is restricted as you can see below images




2. if you want to raise error at time of vendor creation add below code of snippet in res_partner.py file.

//Code2 in Comment//

3. To restrict vendor creation totally, you have to remove create access from the product template's puchase tab and in purchase order , so for that add below snippet code in xml file.


//Code3 in Comment//


by using this you can restrict vendor creation by considering multiple scenario as I have Provided.


Hope this Helps,


If you need any help in customization feel free to contact us..


Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

0
Avatar
Descartar
Jainesh Shah(Aktiv Software)

Code 1:

@api.model
def get_views(self, views, options=None):
res = super().get_views(views=views, options=options)
action_id = self.env["ir.actions.act_window"].browse(options.get("action_id"))
context = ast.literal_eval(action_id.context)
context.update({'create': False})
action_id.context = context
return res

Code 2 :

@api.model
def create(self, vals):
res = super().create(vals)
if self.env.context.get("res_partner_search_mode") == 'supplier':
raise UserError("You can't create vendor !!")
return res

Code 3:

<record id="product_supplierinfo_subcontractor_tree_view_test" model="ir.ui.view">
<field name="name">product.supplierinfo.subcontractor.tree.view.test</field>
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
</xpath>
</field>
</record>

<record id="view_purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="attributes">
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
</field>
</field>
</record>

¿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
Custom Access Rights are not visible in normal mode, Only visible under Developer mode (v16)
access rights
Avatar
0
ago 23
8
How to learn Access Rights
access rights
Avatar
Avatar
Avatar
2
nov 22
4418
In a project only the admin can see the team members but the user can't
access rights
Avatar
Avatar
2
mar 15
5386
The requested operation cannot be completed due to security restrictions. Please contact your system administrator. document type: users, operation:read.
error access rights
Avatar
Avatar
1
mar 22
3917
Expenses App | Can I blocked the modification of fields "Manager" and "Journal account" for a new expenses request entered by a basic user ?
expenses access rights
Avatar
0
sept 19
1890
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