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 create my own view?

Odoberať

Get notified when there's activity on this post

This question has been flagged
formviewcreate
4 Replies
20561 Zobrazenia
Avatar
Frankie Chan

Hi, I have modified the form view by inheritance by the following code in the py file:

-----------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record model="ir.ui.view" id="view_ct_form">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form" />
        <field name="arch" type="xml">

            <field name="street2" position="attribute">          
            <attribute name="invisible">1</attribute>
            </field>
       </field>          
   </record>
-----------------------------------------------------------------------------------------------------------------------------------

Now I would like to create my own form view, "view_ct_form", instead of replacing fields, adding fields, deleting fields and so on. What is the code I should use?

Thanks a lot.

0
Avatar
Zrušiť
Emipro Technologies Pvt. Ltd.

Hi Frankie, Can you brief more about your question what exactly you want to do for creating a view, because when you say "my own form view" then  along with it you will have to modify the "action" * which will open your view instead of default. If you inherit a view than it will be mandatory to use the *"position" *attribute for putting a field *"after, before or replace"*  on the form view.

OdooBot
Hi Hiren,

I am new to openerp.

I want to change "res_partner_view.xml". More accurately, I only want to change "view_partner_form" and "view_partner_tree" and keep others, such as action, menu-item, unchanged.

How can it be done?

Furthermore, can I copy the whole "res_partner_view.xml" to a new xml file called "new_view.xml" and just edit "view_partner_form" and "view_partner_tree"? Should I copy other files, e.g. css, __openerp__.py?

Thanks a lot.

Frankie


On Fri, Jul 4, 2014 at 8:32 PM, <Hiren@mail1.openerp.com> wrote:

Hi Frankie, Can you brief more about your question what exactly you want to do for creating a view, because when you say "my own form view" then  along with it you will have to modify the "action" * which will open your view instead of default. If you inherit a view than it will be mandatory to use the *"position" *attribute for putting a field *"after, before or replace"*  on the form view.

Hiren Vora,
Sr. OpenERP Technical Engineer,
Emipro Technologies, India.
www.emiprotechnologies.com
info@emiprotechnologies.com

Sent by OpenERP S.A. using OpenERP. Access your messages and documents in Odoo

Sehrish

All about views in odoo: https://learnopenerp.blogspot.com/2020/09/create-form-tree-view-odoo13.html

Avatar
Manoj
Best Answer

first of all you havre to create the form view like below....        

<record id="myfirst_form_view" model="ir.ui.view">
            <field name="name">scholar.details.form</field>
            <field name="model">scholar.details</field> ------>this is the model name(class name)
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="student.details" version="7.0">
                    <sheet string="student">
                        <h1>
                            <label string="Add Scholar Details"/>
                        </h1>
                        <group string="My First Form View">
                            <field name="name"/>
                            <field name="age"/>
                            <field name="dob"/>
                            <field name="stream_id"/>
                            <field name="status"/>
                        </group>
                        <field name="subject_id"/>
                    </sheet>
                </form>
            </field>
        </record>

then you have to create action view like...

        <record id="action_scholar_details" model="ir.actions.act_window">
            <field name="name">My First Action</field>
            <field name="res_model">scholar.details</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field> ----> here we provide for both tree and form view , while tree view will come erlier
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">
                    test
                </p><p>
                    Description goes Here.
                </p>
            </field>
        </record>

and finally you have to create the menu item like..

        <menuitem id="menu_base_scholar" name="Scholar"/>
        <menuitem id="menu_section_scholar" parent="menu_base_scholar" name="Scholar_Record"/>
        <menuitem id="menu_item_scholar" parent="menu_section_scholar" name="Record Codes" action="action_scholar_details"/>

 

if this will work then its fine else you have to create and add tree view also (you can add this one before or after the form view)

        <record id="myfirst_tree_view" model="ir.ui.view">
            <field name="name">scholar.details.tree</field>
            <field name="model">scholar.details</field>
            <field name="arch" type="xml">
                <tree string="My First Tree View">
                    <field name="name"/>
                    <field name="age"/>
                    <field name="dob"/>
                    <field name="subject_id"/>
                    <field name="stream_id"/>
                    <field name="status"/>
                </tree>
            </field>
        </record>

I think this will surely help you in creating your own view.

1
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
Form view aligned to the left side Solved
form view
Avatar
Avatar
1
nov 25
2536
OpenERP 7: hide Form Header for read only purpose Solved
form view
Avatar
Avatar
1
sep 21
10246
"many2many_tags" show a refrence of the tag not the name !! Solved
form view
Avatar
Avatar
1
jan 24
17832
create form view by replacing the previous screen
form view
Avatar
0
mar 15
3988
sheet tag in a form
form view
Avatar
Avatar
1
mar 15
10714
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