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

Multiple inheritance of same method

Odebírat

Get notified when there's activity on this post

This question has been flagged
3 Odpovědi
1667 Zobrazení
Avatar
Jay Patel

I am developing a custom module and facing an issue like inheriting the Method without super call , and the flow of super breaks.


while in other module i have done the same and override without super some other method but it called the method from other modules that have extended the same 


So can anyone explain the sequence of method calling in odoo , i dont understand if i inherit a method without super , in one case it does not call any super method and in other case it calls , why ?????

0
Avatar
Zrušit
Avatar
Theresia Weissnat
Nejlepší odpověď

I hope your idea will work. Although, I don't understand what custom module you are referring to.

0
Avatar
Zrušit
Theresia Weissnat

Perform the following steps to call the action_confirm method of the education.application model:
Create file application_method.py. You can put this file anywhere you want because the RPC program will work independently.
Add the following code to the file:
from xmlrpc import client
server_url = 'http://localhost:8069'
db_name = 'viin_education'
username = 'admin'
password = 'admin'
common = client.ServerProxy('%s/xmlrpc/2/common' % server_url)
user_id = common.authenticate(db_name, username, password, {})
models = client.ServerProxy('%s/xmlrpc/2/object' % server_url)
if user_id:
# Create application with state draft
application_id = models.execute_kw(db_name, user_id, password,
'education.application', 'create',
[{'name': 'New application', 'application_date': '2022-01-18', 'admission_date': '2022-01-18', 'state': 'draft'}])
# Call action_confirm method on new application
models.execute_kw(db_name, user_id, password,
'education.application', 'action_confirm', [[application_id]])
# check application status after method call
application_data = models.execute_kw(db_name, user_id, password,
'education.application', 'read', [[application_id], ['name', 'state']])
print('Student state after method call:', application_data[0]['state'])
else:
print('Wrong credentials')
3.Run the Python script from Terminal with the following command:
python3 application_method.py
The program will create an enrollment profile with draft status and then we will change the status of the enrollment profile by calling action_confirm method. We will then read the admissions profile data to check the status of the admissions application, which will produce the following output:
application_id= 10
I hope it is information which you mention
https://hill-climbracing.com

Avatar
Jay Patel
Autor Nejlepší odpověď

Yes , but i need to know that other methods that are extending the same method , with super are getting called in some case , and not in others !! why ?


0
Avatar
Zrušit
Avatar
shubham shiroya
Nejlepší odpověď

Inheritance using super(): When you inherit a method and call super() within the overridden method, it allows you to extend or modify the behavior of the original method while still executing the code of the overridden method in the parent class. This ensures that the original functionality is preserved while adding your custom logic.

For example:

class MyModule(models.Model):
_inherit = 'some.other.module'

def my_method(self):
# Custom code before the super call
res = super(MyModule, self).my_method()
# Custom code after the super call
return res

  1. In this case, calling super() invokes the method in the parent class (the original method), and you can modify its behavior as needed.

  2. Inheritance without super(): If you inherit a method but do not include a super() call within the overridden method, the original method in the parent class will not be executed automatically. Instead, only the code within the overridden method will be executed.

    For example:


class MyModule(models.Model):
_inherit = 'some.other.module'

def my_method(self):
# Custom code without calling super()
return # No call to super()

In this case, the original method in the parent class will not be executed unless explicitly called within the overridden method.


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
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