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

How to create view for inherited objects?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
codeexample
2 Replies
9442 Rodiniai
Portretas
Praveen S

hi, I am facing issues related to creating views in inherited objects. I am planning to add a dealer module. Here is my python file. How to create views for it?

dealer.py

from openerp.osv import osv,fields

class dealer(osv.Model):
    _name = 'dealer'
    _inherit = { 'res.partner': 'partner_id', } 
    _columns = { 'name': fields.char('Name', size = 30,required=True), 
                   'region_id': fields.many2one('region.region', 'Region'), }

How to include the partner table info in my view. Pls help me with some examples.

0
Portretas
Atmesti
PARVATHY VIJAYAN P

can you explain your needs clearly

Praveen S
Autorius

Hi Parvathy Vijayan,

I am planning to create a new module dealer. I want to treat this dealer as a partner.All his contact info must be saved in partner and other info will be saved in dealer. That's why i am inheriting the partner module. But the problem is that how to include the fields associated with partner in my view. Please give an explanation with some examples. Its similar to res_user but i can't understand the view associated with that module.

Portretas
nazarii
Best Answer

Why don't you modify existing res.partner class adding new checkbox 'dealer' instead of creating new model? Here is a good explanation of xml inheritance.

1
Portretas
Atmesti
Portretas
Simplify it!
Best Answer

Let me explain you something.

As I see your code you are creating a new object inheriting the res.partner. What you are doing is that you are creating a new class with new record with ANY relation with res.partner.

If you want to create a new place to see the dealers just add a new field on your class.

Like is a company. Is it a dealer?

Then you can create another menu calling the same res_partner_view but with domain filtering only dealers.

0
Portretas
Atmesti
Praveen S
Autorius

hello Grover i need to add some additional info in the dealer table. so i wish to store all the contact info in partner table and other info in dealer table. how it is possible? its similar to res_user but i didn't understand its view structure.

Simplify it!

There are many ways to do it.

Simplify it!

First you can create new fields on the same res.partner. Inherit but without a new name. You can create a new boolean field as i told you "Is it a dealer?" and other additional fields. Then you can add a new tab page below with attrs invisible when is_it_dealer=False. So if it's a dealer then it's going to have additional info

Simplify it!

Another way is creating a new module dealer. But with a many2one field with res.partner. So you can associate a partner to your new module dealer. The new module doesn't need an inheritance of re.partner. You just need a many2one field that links them.

Praveen S
Autorius

Grover my problem is how to use that existing view. Many2one is not suitable for me. i need to use all fields in res_partner. i can't create views for inherited fields. how its possible?

Simplify it!

Well. Maybe if you can give more details about your new view. As I understood is that you are creating a new partner but with more data as a dealer. If that's the case you only have to inherit res.partner and add dealer fields. It's not going to affect the other partners. As I told you you can add a boolean field to check if it's dealer. and depending that field dealer fields are going to be available. That's the way that I see a solution for this. Well that's what I understood.

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
Ejemplo
example
Portretas
0
kov. 24
1749
.update() method not updating values
code
Portretas
0
rugs. 23
2679
Why is the hr.attendance date column called "name"?
code
Portretas
0
rugp. 16
5033
How to refresh the form view in coding in openerp 7?
code
Portretas
0
kov. 15
5518
line code.
code
Portretas
0
liep. 24
3437
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