Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Form View with 4 models

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
modelsformview
2 Antwoorden
4420 Weergaven
Avatar
Pedro Leite

Hi,

 I have a form view with 3 pages in the notebook. I need to have 3 models in the same form, but the ODOO only allows one. Is there any way around this?


Best regards

0
Avatar
Annuleer
Avatar
Jignesh Mehta
Beste antwoord

Hello Pedro,


For this, you can use _inherits concepts of odoo.

For Ex :-

class MainModel(models.Model):

     _name = 'main.model'

      _inherits = {'model.a': 'a_id', 'model.b': 'b_id', 'model.c':'c_id'}

     a_id = fields.Many2one('model.a', 'A')

     b_id = fields.Many2one('model.b', 'B')

     c_id = fields.Many2one('model.c', 'C')

     # another fields which you want to display


class ModelA(models.Model):

     _name = 'model.a'

     a_name = fields.Char('A Name')

     # another fields for A model

class ModelB(models.Model):

     _name = 'model.b'

     b_name = fields.Char('B Name')

     # another fields for A model


class ModelC(models.Model):

     _name = 'model.c'

     c_name = fields.Char('C Name')

     # another fields for A model


In Xml :-

<record id="new_view" model="ir.ui.view">
    <field name="name">main.model</field>
    <field name="model">main.model</field>
    <field name="arch" type="xml">
        <form> 
            <sheet>     
                <notebook>
                    <page string="A">
                        <field name="a_name"/>
                    </page>
                    <page string="B">
                        <field name="b_name"/>
                    </page>
                    <page string="C">
                        <field name="c_name"/>
                    </page>                    
                </notebook>
        </sheet>
      </form>
    </field>
</record>

Hope it works for you.

Thanks,

0
Avatar
Annuleer
Prakash

@Jignesh Mehta, you have change the "has a" relation in the "is a" relation , it will create a huge burden on db schema as the data size grow in MOdel A,B and C , this is not right

Jignesh Mehta

Hello @Prakash, This is the only way to do that for @Pedro's situation.

Bhavik Bagadiya

@Prakash Sharma in odoo we have a facility of _inherits so we can use relation to use data like as example given by @Jignesh Mehta so we can use this way , and from my point of view @Jignesh Mehta is right. Thanx

Avatar
Pedro Leite
Auteur Beste antwoord

Hi @Jigness Mehta,

thanks for the answer. I already have this structure, the problem is I want to put a form in each page of the notebook. I tried to do this:

<field name="payment_ids">
   <form string="Payments">
        <field name="name"/>
    </form>
</field>

However, this form only appears when I click "Add an item" in the list that appears by default, because the field "payment_ids" is a One2Many.

0
Avatar
Annuleer
Jignesh Mehta

see my updated ans. It will help you.

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Reuse field from a different Model
models
Avatar
Avatar
1
nov. 25
391
V17 Tree, Form view Opgelost
formview
Avatar
1
mrt. 25
3045
How can I use two models in an API (foreign key - relations)?
models
Avatar
0
dec. 24
2320
Import Data From Another Model Opgelost
models
Avatar
Avatar
1
mrt. 24
3467
how can i return a form view from a model method and i just want to show only a specific field instead of all the fields of this model ? Opgelost
models
Avatar
Avatar
1
dec. 25
13615
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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