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

problem with import Many2one with relation in xml.

Subscriure's

Get notified when there's activity on this post

This question has been flagged
xmlmany2oneinheritkeyerror
4 Respostes
4892 Vistes
Avatar
Elian nicaise

I have a problem with the import of a many2one in the xml, I tried with a basic fields.char and it works.


class tags_etiquette(models.Model):
_name = 'etiquette.tags'
_rec_name = 'tags_for_etiquette'

tags_for_etiquette = fields.Char(string='Nom de l\'étiquette')

class tags_created(models.Model):
_inherit = 'res.partner'

tags_etiquette = fields.Many2one('etiquette.tags', string="Étiquette")

class tags_created_facture_bc(models.Model):
_inherit = 'sale.order'

tags_eti = fields.Many2one('etiquette.tags', string="Étiquette", related="partner_id.tags_etiquette")

alex = fields.Char(string="AlexDir")

in xml

<record id="view_created_search_form_bc" model="ir.ui.view">
<field name="name">tags.created.form.bc</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<filter name="customer" position="before">
<filter string="Etiquette" name="group_etiquette_bc" context="{'group_by':'tags_eti'}"/>
</filter>
</field>
</record>

The xml file doesn't find the tags_eti with error KeyError but if i put alex it's work. I don't understand at all why, if someone has a solution and the explanation I'm taking


Best regard


0
Avatar
Descartar
paidy kumar

please try to post error so that readers can understand easily about error.

Elian nicaise
Autor

Hello,

The error as follow:

Odoo Server Error

Traceback (most recent call last):

File "/odoo/odoo-server/openerp/http.py", line 659, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/odoo/odoo-server/openerp/http.py", line 696, in dispatch

result = self._call_function(**self.params)

File "/odoo/odoo-server/openerp/http.py", line 332, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/odoo/odoo-server/openerp/http.py", line 325, in checked_call

result = self.endpoint(*a, **kw)

File "/odoo/odoo-server/openerp/http.py", line 975, in __call__

return self.method(*args, **kw)

File "/odoo/odoo-server/openerp/http.py", line 525, in response_wrap

response = f(*args, **kw)

File "/odoo/odoo-server/addons/web/controllers/main.py", line 897, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/odoo/odoo-server/addons/web/controllers/main.py", line 889, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/odoo/odoo-server/openerp/models.py", line 2070, in read_group

for gb in groupby_list

File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/odoo/odoo-server/openerp/api.py", line 354, in old_api

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

File "/odoo/odoo-server/openerp/models.py", line 1936, in _read_group_process_groupby

qualified_field = self._inherits_join_calc(self._table, split[0], query)

File "/odoo/odoo-server/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/odoo/odoo-server/openerp/models.py", line 2197, in _inherits_join_calc

translate = model._columns[field].translate

KeyError: u'tags_eti'

Avatar
Kiran K
Best Answer

This is possibly because you didn't add correct dependency in your module ,

Make sure you added depends correctly in manifest file


2
Avatar
Descartar
Avatar
Elian nicaise
Autor Best Answer

Hello,

the error is as follow:


Odoo Server Error
Traceback (most recent call last):
  File "/odoo/odoo-server/openerp/http.py", line 659, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/openerp/http.py", line 696, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/openerp/http.py", line 332, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/openerp/http.py", line 325, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/openerp/http.py", line 975, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/openerp/http.py", line 525, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 897, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 889, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/odoo/odoo-server/openerp/models.py", line 2070, in read_group
    for gb in groupby_list
  File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/odoo/odoo-server/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/odoo/odoo-server/openerp/models.py", line 1936, in _read_group_process_groupby
    qualified_field = self._inherits_join_calc(self._table, split[0], query)
  File "/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/odoo/odoo-server/openerp/models.py", line 2197, in _inherits_join_calc
    translate = model._columns[field].translate
KeyError: u'tags_eti'
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
Showing many2one fields in other modules Solved
xml many2one
Avatar
Avatar
Avatar
2
de febr. 18
13203
Problem with many2one field in models which inerit res.partner
many2one inherit
Avatar
Avatar
2
de març 15
17275
many2one field in inherited class ?
many2one inherit
Avatar
0
de març 15
4830
create sequence depending on a Many2one field
xml many2one sequence
Avatar
Avatar
Avatar
3
d’oct. 20
7107
many2one field in xml attrs
attrs xml many2one
Avatar
Avatar
2
de jul. 18
8906
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