Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to inherit from view to add an element in it ?

Odoberať

Get notified when there's activity on this post

This question has been flagged
viewinherit
1 Odpoveď
9421 Zobrazenia
Avatar
Oussama

Hello, I'm getting difficulties to add an element to existing view by inheriting it and adding the new element as specified in the documentation. In fact the original view is not changed, and the inherited view has no effect..

Here is what I get whether before or after adding the inherit view (which should add a page for Radiology ) : http://img11.hostingpics.net/pics/596530Screenshotfrom20140721132617.png

Here is the code of the original view : ( I pasted only the part specific to the <form> )

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
         <record id="view_oemedical_patient_form" model="ir.ui.view">
             <field name="name">oemedical.patient.form</field>
             <field name="model">oemedical.patient</field>
             <field name="priority" eval="8" />
             <field name="arch" type="xml">
              <form string="Patient" version="7.0">
                    <sheet>
                        <div>
                            <field name="photo" widget='image' class="oe_left oe_avatar"/>
                            <div>
                                 <h1>
                                    <field name="first_name" placeholder="First Name" style="width: 20%%" on_change="onchange_name(first_name, lastname, slastname, context)"  />
                                    <!-- some other fields -->
                                </h1>
                            </div>
                 <!-- some other code -->
                        </div>
                    <notebook>
                        <page string="General Information">
                            <group  col="6" colspan="4">
                                 <field name="blood_type" style="width: 8%%"/>
                                 <field name="rh" nolabel="1"/>
                                   <field name="ethnic_group" />
                            </group>
                            <group string="Contact Information">
                                <group>
                                    <label for="street" string="Address"/>
                                    <div>
                                        <field name="use_parent_address" class="oe_edit_only oe_inline" invisible="1"/>
                                        <label for="use_parent_address" class="oe_edit_only" invisible="1"/>
                                        <field name="street" placeholder="Street..." />
                     <!-- many other fields -->
                                </group>
                            </group>
                         </page>

<!-- other pages composing the notebook -->

                        <page string="Misc">
                            <group colspan="4" col="4">
                                <separator colspan="4" string="Patient Extra Information"/>
                                  <field name="general_info" nolabel="1"  colspan="4"/>
                            </group>
                            <newline/>
                            <group colspan="4" col="6">
                                <field name="deceased"/>
                                <field name="dod" attrs="{'invisible':[('deceased','=',False)],'required':[('deceased','=',True)]}"/>
                                <field name="cod" attrs="{'invisible':[('deceased','=',False)]}"/>
                            </group>
                        </page>

<!-- some other code -->

                    </notebook>
                 </sheet>
                 </form>
             </field>
         </record>

    </data>
</openerp>

And here is the code of the inherited view :

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>

        <record model="ir.ui.view" id="view_oemedical_patient_form_radio_logy">
            <field name="name">oemedical.patient.view.inherit.radio_logy</field>
            <field name="model">oemedical.patient</field>
            <field name="inherit_id" ref="oemedical.view_oemedical_patient_form" />
            <field name="type">form</field>
            <field name="arch" type="xml">
                <data>
                    <xpath expr="//notebook/page[@string='Misc']" position="before">
                        <page string="Radiology" id="page_radiology">
                            <notebook>
                                <page string="Main" id="page_ses_main">
                                    <group colspan="4" col="4" id="group_ses_holder2">
                                        <field name="ses"/>
                                        <field name="housing"/>
                                        <field name="education"/>
<!--                                        <field name="occupation"/>-->
                                    </group>
                                    <newline/>

<!-- other groups -->

                                </page>
                            </notebook>
                        </page>
                    </xpath>
                </data>
            </field>
        </record>

    </data>
</openerp>

Everything remains the same, no errors, nothing, the original view is not affected.. I tried to create a new database for my openerp and to re-install the module on it but nothing changed..

Any help please ?!

0
Avatar
Zrušiť
Avatar
Koffi KPONOUGLO
Best Answer

Before iherit view you have to the exact view_id by reading code or using web client (Setting -> Technical -> User Interface -> Views). You have and simple option whose consiste to activate the developper mode(Right Top of screen -> User Name -> About Odoo -> Activate developper mode). By doing this the Deboguer field will appear on every view.

After this, go the view you want to ihnerit   and choose option manage views in Deboguer field . You will get the way to inherit easly your view.

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
How to create another type of Invoice with other sequence?
view inherit
Avatar
0
mar 15
4855
Inherit a predefined view.
view inherit
Avatar
Avatar
1
mar 15
6463
v16: inherit view and add editable treeview in notebook
view inherit odoo16features
Avatar
1
nov 23
2112
Creating new view from a old view Solved
view res.partner inherit
Avatar
Avatar
11
jan 24
14409
Why the same domain for the same field doesn't work at both places?
domain view inherit
Avatar
Avatar
Avatar
Avatar
Avatar
7
aug 18
6997
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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