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

model is not created even though imported in __init__

Subscriure's

Get notified when there's activity on this post

This question has been flagged
modelstutorial
1 Respondre
3531 Vistes
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
Best Answer

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
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 'build a module'...Model not seen in my module
models model tutorial
Avatar
Avatar
4
de nov. 20
7820
How can I use two models in an API (foreign key - relations)?
models
Avatar
0
de des. 24
2148
Import Data From Another Model Solved
models
Avatar
Avatar
1
de març 24
3266
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 ? Solved
models
Avatar
Avatar
1
de juny 23
13425
Error al tratar de borrar un campo en un modelo.
models
Avatar
0
de gen. 23
3758
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