Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Reg - _inherits OpenERP

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
_inherits
1 Balas
7845 Tampilan
Avatar
omprakash

Hai Friends ,

  I am new for OpenERP , I have doubt regards _inherits delegation in OpnenERP .

Can anyone explain _inherits delegation with examples .

Thanks & Regards OMPRAKASH.A

2
Avatar
Buang
Avatar
klacus
Jawaban Terbai

Hi. The inherit methode has a lot of documentation around the net.: You can inherit: - xml for the views, and actions, wizzards, workflows - python codes for the deeper functionality, tables...etc

You can't inherit: - reports The first question is what do you want?

[Edited]

  1. Check the module what you want to inherit, thisi is you find out under addons dir.
  2. You must create a new module, according the followings:
    • create a folder same name what is your new module name.
    • put an __init__.py
    • put an __openerp__.py
    • put mymodule.py
    • put myview.xml inside the folder. All of that should be empty.

Put the following codes inside the __init__.py

import mymodule

this is a relation between the module and your main python code

Put the followings codes into the __openerp__.py

{
    "name" : "mymodule", # the name of the module
    "version" : "0.2", # the version of the module
    "author" : "your name", # your name :-)
    "website" : "", 
    "category" : "Generic Modules/Others", 
    "depends" : ["base","product"], #important points, as you see here must write the name of the inheritted modul name in our example product
    "description" : "your module description", 
    "init_xml" : ["myview.xml"], # important point your xml file what is definie the modified view points.
    "demo_xml" : [], 
    "update_xml" : [], #
    "active": False,
    "installable": True
}

put the following codes into the mymodule.py

class product_product(osv.osv):     
    _name = 'product.product'  # name of the inherited object, in sql you can find the table what name is product_product
    _inherit = 'product.product'
    _columns = { 
    'inheritted_recordname' : fields.char('shape',size=40, required = False, help='Some text what you want see...'),        # the inherited object column properties >> this meaning you create a new column in product_product table, what is char...and so on 
            }
product_product() # end of object def.

put the following code into the myview.xml

<record model="ir.ui.view" id="product_new_form_view_inherit"> 
    <field name="name">product.form.inherit</field>
    <field name="type">form</field>
    <field name="model">product.product</field>
    <field name="inherit_id" ref="product.product_normal_form_view"/>
    <field name="arch" type="xml">
            <field name="name" position="after">                    
    <field name="inheritted_recordname"/>                    

    </field>
    </record>

about view inherit you can find out the docs at: http://doc.openerp.com/v6.0/developer/2_6_views_events/views/view_inheritence.html

  1. Save all.
  2. Refresh the module list
  3. Install your new module.

In this case, if everithing as well, you have a new record in product object. Please watching and understanding the code.

[EDITED 2]

class test(osv.osv): 
_name = "test" 
_inherits = {"notebook.notebook" : "notebook_id" , 
"bpc.bpc" : "bpc_id"} 
_table = "test" 
_description = "Simple bpc" 
_columns = { 
'test' : fields.text('test'), 
'notebook_id' : fields.test('notebook_id'),
'bpc_id' : fields.test('bpc_id'), }

test()

In this case is usable if you want to inherit the data table values. If just the structure, may be you have a clear situation, if you make it all, one by one... "This inheritance mechanism is usually called ” instance inheritance ” or ” value inheritance ”. A resource (instance) has the VALUES of its parents."

2
Avatar
Buang
omprakash
Penulis

Hi Klacus , Thanks for your reply . Actually i have question regards ( _inherits delegation ) OpenERP 1. It is possible for multiple inheritance in OpenERP , If it is possible can you please explain it with sample code . ? 2. Right now i building custom module and exploring the inheritance features in OpenERP (_inherit & _inherits delegation ) I have idea about _inherit but i have no idea about _inherits delegation . Can you please explain friend . And once again thank you klacus for your reply .

klacus

Hi. Ok. We are a bit closer. :-) Please post out your code, and we can see what we can do. You can write down what is your target, and may be I can explain to you how it's work. Please newer forget you need a lot of trial before your code will be good enough for the general use. I waiting for your codes. Regards.

omprakash
Penulis

Hi klacus , Thanks for your reply . I will just share with you what is my need & please clear my doubt . Basically i am java developer , For my client i need to move for python (OpenERP ) . I started learning OpenERP and i realized the excellent features . Actually my role will be for my client (To create a new custom module & customize the existing module ) . After i learn OpenERP technical document & i tried to implement . Klacus still i have no idea about _inherits delegation . http://doc.openerp.com/trunk/developers/server/03_module_dev_02/#inheritance-by-delegation-inherits

omprakash
Penulis

I used this link for my technical training . This is my sample code.... from osv import fields, osv import time

class test(osv.osv): _name = "test" _inherits = {"notebook.notebook" : "notebook_id" , "bpc.bpc" : "bpc_id"} _table = "test" _description = "Simple bpc" _columns = { 'test' : fields.text('test'), 'notebook_id' : fields.test('notebook_id'), 'bpc_id' : fields.test('bpc_id'), }

test()

klacus

Ok. I post you some basic features... :-)

omprakash
Penulis

klacus , whether the sample code for _inherits is correct or not .. please clarify my doubt . And once again thanks for your reply

klacus

If you have a problem/ question, just put here. If I can I will help you.

omprakash
Penulis

Hi Klacus , Thanks for your immediate reply . I can understand the point what you shared with me . Further i have doubt in Topics (Inheritance by Delegation - _inherits Syntax ::

class tiny_object(osv.osv) _name = 'tiny.object' _table = 'tiny_object' _inherits = { 'tiny.object_a': 'object_a_id', 'tiny.object_b': 'object_b_id', ... , 'tiny.object_n': 'object_n_id' } (...) Which was in the link http://doc.openerp.com/trunk/developers/server/03_module_dev_02/#inheritance-by-delegation-inherits

klacus

Yeah, the "delegation" key is a bit..... :-) So in the upside sample you can see all of the things what is there.: http://doc.openerp.com/trunk/developers/server/03_module_dev_02/#inheritance-by-delegation-inherits If you think, you question is answered please close the topic... Bye.

omprakash
Penulis

Hi klacus , thanks for reply . I will make use of it .

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
unable to add column in res.users table Diselesaikan
_inherits
Avatar
Avatar
Avatar
Avatar
Avatar
17
Des 21
25846
how to change default digits of precision?
_inherits
Avatar
Avatar
1
Des 18
20465
TypeError: The model "fleet.vehicle" specifies an unexisting parent class "fleet.vehicle"
_inherits
Avatar
Avatar
Avatar
2
Mar 15
9707
inherited view from base_calendar view
_inherits
Avatar
Avatar
2
Mar 15
11512
aading a new menuitem in fleet module
_inherits
Avatar
Avatar
2
Mar 15
6207
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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