Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

model is not created even though imported in __init__

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
modelstutorial
1 Responder
3534 Vistas
Avatar
吴毅

This is the model file

from odoo import fields, models


class PropertyOffer(models.Model):

_name = 'longdick.estate.offer'
_description = 'Offers data of a property, One to Many relation. One: property, many: offers'

price = fields.Float(default = 500000, string = 'Offer Price', required = True)
status = fields.Selection(string = 'Offer Status',
default
= 'considering',
selection
= [
('accepted', 'Accepted'),
('considering', 'Considering'),
('negotiating', 'Negotiating'),
('refused', 'Refused'),
],
copy
= False)
offer_maker = fields.Many2one('res.partner', string = 'Offer Maker', required = True)
property = fields.Many2one('longdick.estate', string = 'Property', required = True)



==============================
This is my init file

from . import longdick_estate, \
longdick_estate_property_type, \
longdick_estate_property_tag, \
longdick_estate_offer

The first three models were just working fine, however, the fourth just couldn't be created
I even tried to reboot my PC, just not working.

I checked both technical setting and my database in postgreSQL, there's no my offer table.
However, estate/property_type/property_tag and estate&tag rel table are created properly.

I'm also sure about that my ir model access csv​ is set properly, as below:

id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_longdick_estate,longdick.estate,model_longdick_estate,base.group_user,1,1,1,1
access_longdick_estate_offer,longdick.estate.offer,model_longdick_estate_offer,base.group_user,1,1,1,1
access_longdick_estate_property_tag,longdick.estate.property.tag,model_longdick_estate_property_tag,base.group_user,1,1,1,1
access_longdick_estate_property_type,longdick.estate.property.type,model_longdick_estate_property_type,base.group_user,1,1,1,1

Furthermore, I'm using superuser mode, therefore, it's shouldn't be a problem, even if I have some typo in the access file.

Thanks for answering in advance!!!


@Mehjabin Farsana, Thank you miss mehjabin for answering my question so fast.
And sorry for replying your answer in such a way because I don't have enough karma points.
However, your answer doesn't quit solve my problem. Would you mind help me a little bit more?


Problem solved, I just uninstalled my App and then installed it. It began to work.





0
Avatar
Descartar
Avatar
Mehjabin Farsana
Mejor respuesta

Hi,

Can you ensure that the model is created or not by checking in the Models menu under settings -> technical -> database structure -> models.

If it get added there and if you are talking about missing menu, please make sure that you have defined the access rights for your model in ir.model.access.csv file for users to access this model.

Points to check:
1. Ensure odoo service is restarted
2. python file is imported in the init
3. Module is upgraded in the db


Thanks

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Odoo 'build a module'...Model not seen in my module
models model tutorial
Avatar
Avatar
4
nov 20
7835
How can I use two models in an API (foreign key - relations)?
models
Avatar
0
dic 24
2151
Import Data From Another Model Resuelto
models
Avatar
Avatar
1
mar 24
3267
how can i return a form view from a model method and i just want to show only a specific field instead of all the fields of this model ? Resuelto
models
Avatar
Avatar
1
jun 23
13429
Error al tratar de borrar un campo en un modelo.
models
Avatar
0
ene 23
3761
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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