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)
HR payroll Employees attendances Payslips
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
HR payroll Employees attendances Payslips
Acerca de este foro
  1. Human Resources
  2. Foro

Odoo CE v13. Time Off module - ordinary users do not see the all records.

Suscribirse

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

Se marcó esta pregunta
securityholidaysrecord_rules13.0
1 Responder
2440 Vistas
Avatar
Vasyl Melnychuk

Hi! I wasted 4 hours searching and yet can not find a good solution. In nightly build 31.03 every user could see all unavailabilities in Time Off\Everyone. After I upgraded the module to the May version, one record rule for some reason has been simply updated. I have found how to fix it manually but to make sure this never happens again, I wrote a small add-on. However, the same technique I saw in the original source code, does not work for my custom code!

I am trying to override the record rule:

    <record id="hr_leave_rule_employee" model="ir.rule">
        <field name="name">Time Off base.group_user read</field>
        <field name="model_id" ref="hr_holidays.model_hr_leave"/>
        <field name="domain_force">[(1,'=',1)]</field>
        <field name="perm_create" eval="False"/>
        <field name="perm_write" eval="False"/>
        <field name="perm_unlink" eval="False"/>
        <field name="groups" eval="[(4,ref('base.group_user'))]"/>
    </record>
and I tried a variety of the model ref samples, but none of them work, and only one

hr_holidays.hr_leave_rule_employee
 is definitely wrong, but worked out and strangely created an additional rule with the reference to Qweb Field, while the proper value
hr_holidays.model_hr_leave

throws the following error message:

Error: Odoo Server Error Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse self._tag_root(de) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root f(rec) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record record = model._load_records([data], self.mode == 'update') File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create return self.create(values) File "<decorator-gen-51>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 199, in create res = super(IrRule, self).create(vals_list) File "<decorator-gen-3>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3742, in create records = self._create(data_list) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3895, in _create records._validate_fields(name for data in data_list for name in data['stored']) File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields check(self) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in _check_model_transience if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in <genexpr> if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/api.py", line 463, in __getitem__ return self.registry[model_name]._browse(self, (), ()) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 177, in __getitem__ return self.models[model_name] KeyError: 'hr.leave' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/http.py", line 624, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 14, in reraise raise value File "/usr/lib/python3/dist-packages/odoo/http.py", line 669, in dispatch result = self._call_function(**self.params) File "/usr/lib/python3/dist-packages/odoo/http.py", line 350, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call result = self.endpoint(*a, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 915, in __call__ return self.method(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap response = f(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1326, in call_button action = self._call_kw(model, method, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1314, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/api.py", line 387, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/api.py", line 374, in _call_kw_multi result = method(recs, *args, **kwargs) File "<decorator-gen-66>", line 2, in button_immediate_upgrade File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 72, in check_and_log return method(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 634, in button_immediate_upgrade return self._button_immediate_function(type(self).button_upgrade) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 419, in load_modules force, status, report, loaded_modules, update_module, models_to_check) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 315, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 225, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 736, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 803, in convert_xml_import obj.parse(doc.getroot()) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 721, in parse exc_info[2] File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 13, in reraise raise value.with_traceback(tb) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse self._tag_root(de) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root f(rec) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record record = model._load_records([data], self.mode == 'update') File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create return self.create(values) File "<decorator-gen-51>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 199, in create res = super(IrRule, self).create(vals_list) File "<decorator-gen-3>", line 2, in create File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi return create(self, arg) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3742, in create records = self._create(data_list) File "/usr/lib/python3/dist-packages/odoo/models.py", line 3895, in _create records._validate_fields(name for data in data_list for name in data['stored']) File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields check(self) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in _check_model_transience if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_rule.py", line 67, in <genexpr> if any(self.env[rule.model_id.model].is_transient() for rule in self): File "/usr/lib/python3/dist-packages/odoo/api.py", line 463, in __getitem__ return self.registry[model_name]._browse(self, (), ()) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 177, in __getitem__ return self.models[model_name] odoo.tools.convert.ParseError: "hr.leave" while parsing /mnt/extra-addons/augusta_time_off/security/hr_holidays_security.xml:2, near <odoo> <record id="hr_leave_rule_employee" model="ir.rule"> <field name="name">Time Off base.group_user read</field> <field name="model_id" ref="hr_holidays.model_hr_leave"/> <field name="domain_force">[(1,'=',1)]</field> <field name="perm_create" eval="False"/> <field name="perm_write" eval="False"/> <field name="perm_unlink" eval="False"/> <field name="groups" eval="[(4,ref('base.group_user'))]"/> </record> </odoo>

What is wrong? Thanks in advance!


0
Avatar
Descartar
Avatar
Vasyl Melnychuk
Autor Mejor respuesta

in addition what is quite strange:

the record rule I want to change has id=40, and if I use ref = hr_holidays.hr_leave_rule_employee, it creates a new rule referencing the model  ir.qweb.field (XML ID = base.model_ir_qweb_field), and what a coincidence - its id is also 40!

select * from ir_rule where id = 40

...returns 1 record which I want to amend, and I have a feeling that the XML parser somehow looks up for id value (40), not model_id value (197) in ir_model:

select * from ir_model where id = 40
0
Avatar
Descartar
¿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
Security groups and record rules Resuelto
security record_rules
Avatar
Avatar
1
nov 24
2444
Add unlink = False for record rule not work
security record_rules
Avatar
0
ago 21
3254
[13.0] how to restrict access to a website page for portal users with a condition
security record_rules permissions website 13.0
Avatar
1
sept 20
7211
Restrict access by company Resuelto
security record_rules
Avatar
1
jun 19
4942
How to segregate contact records using record rules
security record_rules permissions
Avatar
Avatar
2
nov 24
2150
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