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

I try install my first module and not work.

Subscriure's

Get notified when there's activity on this post

This question has been flagged
odoo11communityodoo11.0Version
5 Respostes
4330 Vistes
Avatar
Aitor

Hello everyone, i try to install my first module to school, don´t work and I don´t know why. The mistake is ¨module not found¨. I paste here the error and the code to models.py and views.xml. Thank you.

---MISTAKE---

Modelo no encontrado: al.taller.propietarios

Contexto del error:
Vista `taller.propietarios.tree`
[view_id: 1020, xml_id: n/a, model: al.taller.propietarios, parent_id: n/a]
None" while parsing /opt/odoo/odoo11/custom-addons/taller/views/views.xml:6, near
<record model="ir.ui.view" id="taller_propietarios_tree">
        <field name="name">taller.propietarios.tree</field>
        <field name="model">al.taller.propietarios</field>
        <field name="arch" type="xml">
          <tree>
            <field name="name"/>
            <field name="nombre"/>
            <field name="apellido1"/>
            <field name="apellido2"/>
          </tree>
        </field>
      </record>

---MODELS.PY---
from odoo import models, fields, api

class taller_propietarios(models.Model):
_name="al.taller.propietarios"
name=fields.Char(string="DNI",required=True)
nombre=fields.Char(string="Nombre",required=True)
apellido1=fields.Char(string="Primer apellido",required=True)
apellido2=fields.Char(string="Segundo apellido",required=False)
coches = fields.One2many("al.taller.coches",'name',ondelete="cascade")
class taller_mecanicos(models.Model):
_name="al.taller.mecanicos"
name=fields.Char(string="Numero empleado",required=True)
nombre=fields.Char(string="Nombre",required=True)
puesto=fields.Selection((('0','Mecanico'),('1','Chapista'),('2','Jefe taller')),string="Puesto",required=True)
coches = fields.Many2many("al.taller.coches",string="Coches a su cargo")
class taller_coches(models.Model):
_name="al.taller.coches"
name=fields.Char(string="Matricula",required=True)
bastidor=fields.Char(string="Bastidor",required=True)
marca=fields.Char(string="Marca",required=True)
modelo=fields.Char(string="Modelo",required=True)
defectos=fields.Text(string="Defectos del vehiculo",required=True)
propietaros = fields.Many2one("al.taller.propietarios",string="Propietario",ondelete='cascade')
mecanicos = fields.Many2many("al.taller.mecanicos",string="Encargado/s del coche")
class taller_marcas(models.Model):
_name="al.taller.marcas"
name=fields.Char(string="Marca",required=True);
description=fields.Text(string="Descripcion",required=False)
modelos = fields.One2many("al.taller.modelos", string="Modelos", 'coches')
class taller_modelos(models.Model):
_name="al.taller.modelos"
name=fields.Char(string="Modelos")
marcas = fields.Many2one("al.taller.marcas",string="Modelos",ondelete='cascade')

---VIEWS.XML---
<odoo>
<data>

<!--PROPIETARIOS -->

<record model="ir.ui.view" id="taller_propietarios_tree">
<field name="name">taller.propietarios.tree</field>
<field name="model">al.taller.propietarios</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="nombre"/>
<field name="apellido1"/>
<field name="apellido2"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="taller_propietarios_form">
<field name="name">taller.propietarios.form</field>
<field name="model">al.taller.propietarios</field>
<field name="arch" type="xml">
<form>
<group colspan="2" col="2">
<field name="name"/>
<field name="nombre"/>
<field name="apellido1"/>
<field name="apellido2"/>
<field name="coches"/>
</group>
</form>
</field>
</record>

<!-- MECANICOS -->

<record model="ir.ui.view" id="taller_mecanicos_tree">
<field name="name">taller.mecanicos.tree</field>
<field name="model">al.taller.mecanicos</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="nombre"/>
<field name="puesto"/>
<field name="coches"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="taller_mecanicos_form">
<field name="name">taller.mecanicos.form</field>
<field name="model">al.taller.mecanicos</field>
<field name="arch" type="xml">
<form>
<group colspan="2" col="2">
<field name="name"/>
<field name="nombre"/>
<field name="puesto"/>
<field name="coches"/>
</group>
</form>
</field>
</record>

<!-- COCHES -->

<record model="ir.ui.view" id="taller_coches_tree">
<field name="name">taller.coches.tree</field>
<field name="model">al.taller.coches</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="bastidor"/>
<field name="marca"/>
<field name="modelo"/>
<field name="defectos"/>
<field name="propietarios"/>
<field name="mecanicos"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="taller_coches_form">
<field name="name">taller.coches.form</field>
<field name="model">al.taller.coches</field>
<field name="arch" type="xml">
<form>
<group colspan="2" col="2">
<field name="name"/>
<field name="bastidor"/>
<field name="marca"/>
<field name="modelo"/>
<field name="defectos"/>
<field name="propietarios"/>
<field name="mecanicos"/>
</group>
</form>
</field>
</record>

<!-- MARCAS -->

<record model="ir.ui.view" id="taller_marcas_tree">
<field name="name">taller.marcas.tree</field>
<field name="model">al.taller.marcas</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="description"/>
<field name="modelos"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="taller_marcas_form">
<field name="name">taller.marcas.form</field>
<field name="model">al.taller.marcas</field>
<field name="arch" type="xml">
<form>
<group colspan="2" col="2">
<field name="name"/>
<field name="description"/>
<field name="modelos"/>
</group>
</form>
</field>
</record>

<!-- MODELOS -->

<record model="ir.ui.view" id="taller_modelos_tree">
<field name="name">taller.modelos.tree</field>
<field name="model">al.taller.modelos</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="marcas"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="taller_modelos_form">
<field name="name">taller.modelos.form</field>
<field name="model">al.taller.modelos</field>
<field name="arch" type="xml">
<form>
<group colspan="2" col="2">
<field name="name"/>
<field name="marcas"/>
</group>
</form>
</field>
</record>

<!-- ACTIONS -->

<record model="ir.actions.act_window" id="taller.propietarios_action_window">
<field name="name">taller.propietarios.action_window</field>
<field name="res_model">al.taller.propietarios</field>
<field name="view_mode">tree,form</field>
</record>

<record model="ir.actions.act_window" id="taller.mecanicos_action_window">
<field name="name">taller.mecanicos.action_window</field>
<field name="res_model">al.taller.mecanicos</field>
<field name="view_mode">tree,form</field>
</record>

<record model="ir.actions.act_window" id="taller.coches_action_window">
<field name="name">taller.coches.action_window</field>
<field name="res_model">al.taller.coches</field>
<field name="view_mode">tree,form</field>
</record>

<record model="ir.actions.act_window" id="taller_marcas_action_window">
<field name="name">taller.marcas.action_window</field>
<field name="res_model">al.taller.marcas</field>
<field name="view_mode">tree,form</field>
</record>

<record model="ir.actions.act_window" id="taller_modelos_action_window">
<field name="name">taller.modelos.action_window</field>
<field name="res_model">al.taller.modelos</field>
<field name="view_mode">tree,form</field>
</record>

<!-- MENU -->

<menuitem name="Taller" id="taller.menu_root" />
<menuitem name="Propietarios" id="taller.propietarios_menu" parent="taller.menu_root" action="taller.propietarios_action_window" />
<menuitem name="Mecanicos" id="taller.mecanicos_menu" parent="taller.menu_root" action="taller.mecanicos_action_window"/>
<menuitem name="Coches" id="taller.coches_menu" parent="taller.menu_root" action="taller.coches_action_window" />
<menuitem name="Marcas" id="taller.marcas_menu" parent="taller.menu_root" action="taller.marcas_action_window" />
<menuitem name="Modelos" id="taller.modelos_menu" parent="taller.menu_root" action="taller.modelos_action_window" />
</data>
</odoo>



0
Avatar
Descartar
Sehrish

Follow these tips: http://learnopenerp.blogspot.com/

Avatar
Aitor
Autor Best Answer

Thank you all, but yes, in the __inity.py of my models folder, have the line ¨from . import models¨

0
Avatar
Descartar
Avatar
Nasir
Best Answer

Hi Aitor,

Kindlt check if you have written "from . import (module_name_of_yours)" in the __init__.py file listed in the module folder in a module folder. Thanks.

Regards,

Nasir

0
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

HI,

If you are new to odoo development, you can see this videos which explains the basic of how to create a module from scratch in odoo: https://www.youtube.com/watch?v=BDepk0LhVuI&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM


And you can get the code samples used in the above tutorials from this link: https://apps.odoo.com/apps/modules/12.0/om_hospital/


Even though its for v12, it will work in v11 also. Regarding the issue you have told just make sure that you have restarted the service after adding the model, all python files are imported in init file .

Thanks

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi Aitor,
Kindly check if you have omitted to import the models.py in the __init__.py file like below
from . import models
Regards

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
when generating payslip i got this error Solved
odoo11community odoo11.0
Avatar
Avatar
1
de febr. 21
4368
How to programatically move file from i.attachment to specific directory
odoo11community odoo11.0
Avatar
0
de juny 20
3320
Add a button after import button Solved
odoo11community odoo11.0
Avatar
Avatar
2
de gen. 19
6141
How to add a sequence on date that we select from date field ???
odoo11 odoo11community odoo11.0
Avatar
0
de maig 22
4249
Group by function / computed field with out ==> “store = True” in odoo 11 Solved
python3 odoo11community odoo11.0
Avatar
Avatar
1
de març 22
14450
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