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
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • 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
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • 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

AttributeError: 'list' object has no attribute 'with_context'

Subscriure's

Get notified when there's activity on this post

This question has been flagged
migrationcontexthr_holidaysodoo17odoo15
1 Respondre
1870 Vistes
Avatar
David Maxwell

When I migrate from odoo15 to odoo 17 I got this error "AttributeError: 'list' object has no attribute 'with_context'". Here is the error list

RPC_ERROR

Odoo Server Error

Traceback (most recent call last):

  File "/home/cd009/odoo17/odoo17/odoo/http.py", line 1764, in _serve_db

    return service_model.retrying(self._serve_ir_http, self.env)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/service/model.py", line 133, in retrying

    result = func()

             ^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/http.py", line 1791, in _serve_ir_http

    response = self.dispatcher.dispatch(rule.endpoint, args)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/http.py", line 1995, in dispatch

    result = self.request.registry['ir.http']._dispatch(endpoint)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/addons/base/models/ir_http.py", line 222, in _dispatch

    result = endpoint(**request.params)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/http.py", line 741, in route_wrapper

    result = endpoint(self, *args, **params_ok)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/web/controllers/dataset.py", line 28, in call_button

    action = self._call_kw(model, method, args, kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/web/controllers/dataset.py", line 20, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/api.py", line 468, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/api.py", line 453, in _call_kw_multi

    result = method(recs, *args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/hr_holidays/models/hr_leave.py", line 1333, in action_validate

    self.write({'state': 'validate'})

  File "/home/cd009/odoo17/odoo17/addons/project_timesheet_holidays/models/hr_holidays.py", line 156, in write

    res = super().write(vals)

          ^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/hr_holidays_attendance/models/hr_leave.py", line 31, in write

    res = super().write(vals)

          ^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/hr_holidays/models/hr_leave.py", line 998, in write

    result = super(HolidaysRequest, self).write(values)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/mail/models/mail_thread.py", line 317, in write

    result = super(MailThread, self).write(values)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/mail/models/mail_activity_mixin.py", line 250, in write

    return super(MailActivityMixin, self).write(vals)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/odoo/models.py", line 4435, in write

    real_recs._validate_fields(vals, inverse_fields)

  File "/home/cd009/odoo17/odoo17/odoo/models.py", line 1459, in _validate_fields

    check(self)

  File "/home/cd009/odoo17/penygoncielo/om_hr_payroll/models/hr_leave_type.py", line 895, in _check_holidays

    mapped_days = self.holiday_status_id.get_allocation_data((self.employee_id | self.employee_ids).ids)

                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/hr_holidays_attendance/models/hr_leave_type.py", line 37, in get_allocation_data

    res = super().get_allocation_data(employees, date)

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/cd009/odoo17/odoo17/addons/hr_holidays/models/hr_leave_type.py", line 403, in get_allocation_data

    allocations_leaves_consumed, extra_data = employees.with_context(

                                              ^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'list' object has no attribute 'with_context'


The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    RPCError@http://localhost:8079/web/assets/7f5bbba/web.assets_web.min.js:2883:319

    makeErrorFromResponse@http://localhost:8079/web/assets/7f5bbba/web.assets_web.min.js:2886:163

    jsonrpc/promise</<@http://localhost:8079/web/assets/7f5bbba/web.assets_web.min.js:2890:34

   

Anyone please give suggestions to fix this error


0
Avatar
Descartar
Avatar
Milin
Best Answer

 File "/home/cd009/odoo17/penygoncielo/om_hr_payroll/models/hr_leave_type.py", line 895, in _check_holidays

    mapped_days = self.holiday_status_id.get_allocation_data((self.employee_id | self.employee_ids).ids)


It looks like here you have passed the employee id instead of the object hence the error.

Just remove the .ids and try again.

0
Avatar
Descartar
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
migration from odoo16 to 17
migration odoo17 odoo16
Avatar
Avatar
1
de nov. 25
2023
The `account.financial.html.report` model from Odoo 15 is not found in Odoo 17. Solved
odoo odoo17 odoo15
Avatar
Avatar
1
de nov. 24
3153
Migration odoo 16 enterprise to 17
migration odoo17 odoo16
Avatar
Avatar
1
de nov. 24
2997
Native Views Not Updating After Module Upgrade in Odoo 18 on Odoo SH
migration odoo.sh odoo18 odoo17
Avatar
Avatar
2
de jul. 25
2696
Migrate database Odoo V17 to V18. Solved
migration login Odoo18.0 odoo17
Avatar
Avatar
1
de gen. 25
1798
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