Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Multiple module single model inheritance problem.

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
functionmoduleinheritancemodelmutil
4062 Rodiniai
Portretas
Ken.

Hi All,

I have four modules. (DY_A,DY_B,DY_C,DY_D)

The A has one model and one function (def function01). 

The B\C\D inherit A and they inhert A's function01.


DY_A:

from odoo import models, fields, api
# AAAAAAAAAAAAAAAAAA

class A(models.Model):
_name = 'dy.a'

def func(self):
a = 1
return a

DY_B:

from odoo import models, fields, api
##### BBBBBBBBBBBBBBBBBBBBBBBBB

class B(models.Model):
_inherit = 'dy.a'

def func(self):
res = super(B, self).func()
a = 2
return a

DY_C:

from odoo import models, fields, api
#CCCCCCCCCCCCCCCCC

class C(models.Model):
_inherit = 'dy.a'

def func(self):
res = super(C, self).func()
a = 3
print(C.mro())
return a

DY_D:

from odoo import models, fields, api
#DDDDDDDDDDDDDDDDDDDDD

class D(models.Model):
_inherit = 'dy.a'

def func(self):
res = super(D, self).func()
a = 4
print(D.mro())
return a
I don't understand how their inheritance execution order is handled? Who Can Help Me?
0
Portretas
Atmesti
Divyansh Tripathi

Not sure what you are trying to achieve here but the model to get defined last in the line gets executed first. Also, I see that you are trying not to return the result you got from calling the super method rather returning something different so I suggest you make sure that you don't need the values you are getting from the super method.

Ken.
Autorius

I Just want to test the inheritance order.

A(module)

/ | \

/ | \

B C D (module)

B\C\D are the same level. If all they inherit A and rewrite the A's function. What's execution order and why?

I find that the execution order of the function is D->C->B->A,But I don't understand the reason.

Is it related to the order of installation or modules' name?

Thanks.

Ken.
Autorius

I Just want to test the inheritance order.

                      A(module)

                    / | \ 

                  /   |    \ 

                B   C     D (module)

B\C\D are the same level. If all they inherit A and rewrite the A's function. What's execution order and why?

I find that the execution order of the function is D->C->B->A,But I don't understand the reason.

Is it related to the order of installation or modules' name?

Thanks.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
How to remove certain columns from an inherited model? Solved
module inheritance model project.task
Portretas
Portretas
Portretas
Portretas
3
lapkr. 22
13782
Error in inheritance a model with Many2many field Solved
inheritance model
Portretas
Portretas
Portretas
2
birž. 25
1760
Inheritet Model's field can not be changed over method
inheritance model
Portretas
Portretas
Portretas
2
birž. 25
3989
How to display a field from a different model?
module model
Portretas
1
kov. 15
6222
How to fix the error to install module "Missing required value for the field 'Model' (model_id) "
module app model
Portretas
Portretas
1
vas. 25
1907
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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