Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Error with inheritance odoo v16

Naroči se

Get notified when there's activity on this post

This question has been flagged
inheritancerelationship
1 Odgovori
2484 Prikazi
Avatar
José Calambrogio

When I try to add a new record to mu_condominio class I have the problem. Could be the inheritance or the relation Many2One of the field: "persona_contacto_id"

the code below:

class mu_condominio(models.Model):
_name = 'mu_condominio.mu_condominio'
_description = 'Condominio Condominio'
_inherit = 'res.partner'


# define nuevas relaciones con nombres diferentes para evitar duplicados.
user_ids = fields.Many2many('res.users', 'mu_condominio_users_rel', 'cid', 'user_id', string='Accepted Users')
channel_ids = fields.Many2many('mail.channel', 'mu_condominio_channel_rel')


persona_contacto_id = fields.Many2one('res.partner', string='Persona de Contacto', required=False, index=True)
tipo_propiedad = fields.Selection([("Condominio", "Condominio"), ("Condominio Privado", "Condominio Privado"), ("Condominio de PLaya", "Condominio de Playa"), ("Edificio Multifamiliar", "Edificio Multifamiliar"), ("Edificio de Departamentos", "Edificio de Departamentos"), ("Edificio de Oficinas", "Edificio de Oficinas"), ("Edificio Comercial", "Edificio Comercial")], default="Condominio", required=True, string="Tipo de Propiedad")
mu_condominio_interior_ids = fields.One2many(comodel_name='mu_condominio.mu_condominio_interior', inverse_name='condominio_id', string='Propiedades Interiores')
total_interiores = fields.Integer(string="Total Interiores", compute="count_interiores")

#Funciones
@api.model
#Llamada en el campo computado Total_Interiores
def count_interiores(self):
return len(self.mu_condominio_interior_ids)



class mu_condominio_interior(models.Model):
_name = 'mu_condominio.mu_condominio_interior'
_description = 'Condominio Interior'

interior = fields.Char(string='Número de Interior', help="Número letra o código que identifica la propiedad interior. Ej: of. 125 / G1")
condominio_id = fields.Many2one('mu_condominio.mu_condominio', string='Condominio',required=True)
area = fields.Float(string="Área de la propiedad", help="Área de la propiedad en metros cuadrados", required=False, default=0)
tipo_interior = fields.Selection([("Departamento", "Departamento"), ("Casa", "Casa"), ("Lote", "Lote"), ("Loft", "Loft"), ("Estudio", "Estudio"), ("Oficina", "Oficina"), ("Módulo", "Módulo"), ("Piso", "Piso")], default="Departamento", required=True, string="Tipo de Propiedad", index=True)
estado = fields.Boolean(string="Estado de la Propiedad", help="Indica si la Propiedad está dada de alta o no", default=True, index=True)
uso = fields.Selection([("Propio", "Uso Propio"), ("Alquiler", "Alquiler"), ("AirBnB", "AirBnB"), ("Oficina", "Oficina"), ("otros", "otros")], default="Propio", required=True, string="Tipo de Uso", help="Uso que se le da a la propiedad. Uso particular, se alquila, oficina, etc.")
observaciones = fields.Text(string='Observaciones')


the error is:

TypeError: inconsistent models in: res.partner(2,) in mu_condominio.mu_condominio(,)

The above server error caused the following client error:
null

0
Avatar
Opusti
Avatar
José Calambrogio
Avtor Best Answer

I can't post the complete error message but I found that:

File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
    return super()._compute_field_value(field)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4196, in _compute_field_value
    getattr(self, field.compute)()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/res_partner.py", line 338, in _compute_partner_share
    if super_partner in self:

The error could be with the compute field value "partner_share" from "res.partner"

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Why my bidirectional many2many is not showing data?
inheritance relationship many2many
Avatar
Avatar
2
mar. 15
12667
Can't inherit base.view_partner_form of res.partner
inheritance
Avatar
Avatar
Avatar
Avatar
Avatar
4
feb. 25
4539
Include in inherit from JS class
inheritance
Avatar
Avatar
1
avg. 24
3129
How to Override a method in parent class in JS Solved
inheritance
Avatar
Avatar
2
nov. 24
4631
How to add a simple field to partner?
inheritance
Avatar
Avatar
Avatar
Avatar
3
okt. 23
15923
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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