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

Odoo.sh upgrade v13-v16 on Branch Staging: AssertionError: Field without selection

Subscriure's

Get notified when there's activity on this post

This question has been flagged
migrationupgradeassertionerrorodoo16featuresSelection
1 Respondre
3504 Vistes
Avatar
Admin Samadeva

After having performed successfully a DB upgrade (v13 to v16) using upgrade.odoo.com and imported it on my staging branch in odoo.sh.

When i connect to this odoo16-Staging-branch (neutralized DB) and try to re-install my custom module (extending website_event) in the Apps, i got this error: AssertionError: Field event.event.state without selection

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 1583, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo/src/odoo/odoo/service/model.py", line 134, in retrying
    result = func()
  File "/home/odoo/src/odoo/odoo/http.py", line 1610, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo/src/odoo/odoo/http.py", line 1807, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo/src/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
    response = super()._dispatch(endpoint)
  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo/src/odoo/odoo/http.py", line 696, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo/src/odoo/addons/web/controllers/dataset.py", line 46, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/home/odoo/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "", line 2, in button_immediate_install
  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_module.py", line 76, in check_and_log
    return method(self, *args, **kwargs)
  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_module.py", line 491, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_module.py", line 615, in _button_immediate_function
    registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "", line 2, in new
  File "/home/odoo/src/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/home/odoo/src/odoo/odoo/modules/registry.py", line 90, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/home/odoo/src/odoo/odoo/modules/loading.py", line 487, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/home/odoo/src/odoo/odoo/modules/loading.py", line 371, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/home/odoo/src/odoo/odoo/modules/loading.py", line 206, in load_module_graph
    registry.setup_models(cr)
  File "/home/odoo/src/odoo/odoo/modules/registry.py", line 297, in setup_models
    model._setup_fields()
  File "/home/odoo/src/odoo/odoo/models.py", line 2803, in _setup_fields
    field.setup(self)
  File "/home/odoo/src/odoo/odoo/fields.py", line 538, in setup
    self.setup_nonrelated(model)
  File "/home/odoo/src/odoo/odoo/fields.py", line 2543, in setup_nonrelated
    assert self.selection is not None, "Field %s without selection" % self
AssertionError: Field event.event.state without selection

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPCError@https://samadeva-oerp-brstaging-8109207.dev.odoo.com/web/assets/83758-b7a4b7b/web.assets_backend.min.js:973:274
    makeErrorFromResponse@https://samadeva-oerp-brstaging-8109207.dev.odoo.com/web/assets/83758-b7a4b7b/web.assets_backend.min.js:977:163
    jsonrpc/promise

I have noticed that the original module event.event has some change (https://github.com/OCA/OpenUpgrade/blob/14.0/openupgrade_scripts/scripts/event/14.0.1.3/post-migration.py) concerning the SelectionFields event.event.state which has been turned into a Many2One-Field: event.event.stage_id

def map_event_event_states_to_stages(env):
    def _map_state_to_stage(state, stage_xmlid):
        query = """
            UPDATE event_event event SET stage_id = imd.res_id
            FROM ir_model_data imd
            WHERE imd.module = 'event' AND imd.name = %s AND event.state = %s"""
        openupgrade.logged_query(env.cr, query, (stage_xmlid, state))

    _map_state_to_stage("draft", "event_stage_new")
    _map_state_to_stage("done", "event_stage_done")
    _map_state_to_stage("cancel", "event_stage_cancelled")
    _map_state_to_stage("confirm", "event_stage_announced")

but, i dont manage to fix this error, even after having re-installed the old fieldSelection using another new custom module:

class EventEvent(models.Model):
    _inherit = 'event.event'

    # TRY to fix error on install webtkev on v16: /odoo/fields.py", line 2543, in setup_nonrelated: AssertionError: Field event.event.state without selection
    state = fields.Selection([
        ('draft', 'Unconfirmed'), ('cancel', 'Cancelled'),
        ('confirm', 'Confirmed'), ('done', 'Done')],
        string='Status', default='draft', readonly=True, required=True, copy=False)

Any idea how to fix it ?


0
Avatar
Descartar
Justine Ladan

Hi, how long did it take to upgrade from version 13 to version 16?

Thanks!

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

I hope this has to be handled with migration scripts, incase if this is not solved yet, create a support ticket for the migration in: https://www.odoo.com/help

Thanks

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
Odoo migration to v16: Error for standard wizard
migration upgrade odoo13 odoo16features
Avatar
Avatar
2
de set. 23
4093
Missing assets when upgrading odoo 16 Solved
migration cache upgrade assets odoo16features
Avatar
1
de febr. 24
6335
Openupgrade guide for windows user ?
migration upgrade OpenUpgrade v15 odoo16features
Avatar
0
de gen. 24
1832
Field used in context is restricted to certain groups Solved
migration odoo16features
Avatar
Avatar
Avatar
3
de juny 24
4102
convert function from odoo14 to odoo 16 with custom updates
upgrade odoo16features
Avatar
0
de jul. 23
3107
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