Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

I try install my first module and not work.

Odebírat

Get notified when there's activity on this post

This question has been flagged
odoo11communityodoo11.0Version
5 Odpovědi
4328 Zobrazení
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
Zrušit
Sehrish

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

Avatar
Aitor
Autor Nejlepší odpověď

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

0
Avatar
Zrušit
Avatar
Nasir
Nejlepší odpověď

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
Zrušit
Avatar
Niyas Raphy (Walnut Software Solutions)
Nejlepší odpověď

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
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

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
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
when generating payslip i got this error Vyřešeno
odoo11community odoo11.0
Avatar
Avatar
1
úno 21
4366
How to programatically move file from i.attachment to specific directory
odoo11community odoo11.0
Avatar
0
čvn 20
3320
Add a button after import button Vyřešeno
odoo11community odoo11.0
Avatar
Avatar
2
led 19
6141
How to add a sequence on date that we select from date field ???
odoo11 odoo11community odoo11.0
Avatar
0
kvě 22
4248
Group by function / computed field with out ==> “store = True” in odoo 11 Vyřešeno
python3 odoo11community odoo11.0
Avatar
Avatar
1
bře 22
14450
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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