Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to add new tab to module?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
purchasefieldscustomizationpurchase_order
14 Respostes
50167 Vistes
Avatar
Maath

Hi,

My question is how to add new tab or (tabs) in my module or existing module

I know the we need to inherit the module we want to add some things and do our changes (As what I do previously (adding one2may & many2one fields))

see below picture will explain what I need

image description

Thank you in advance

5
Avatar
Descartar
Avatar
Atul Makwana
Best Answer

To add page in employee after personal information tab you need to inherit the employee form view in xml like,

 <record id="view_employee_form" model="ir.ui.view">
   	<field name="name">hr.employee.form</field>
    <field name="model">hr.employee</field>
    <field name="inherit_id" ref="view_employee_form"/>
    <field name="arch" type="xml">
	    <xpath expr="//page[@string='Personal Information']" position='after'>
	    	<page string='My new tab'>
	    		
	    	</page>
	    </xpath>
    </field>
</record>
8
Avatar
Descartar
Bienvenido Villabroza

It didn't work for me initially in Odoo 13. I needed to edit this: expr="//page[@string='Personal Information']"

After changing @string to @name and then changing "Personal Information" to the proper name value of the page, it worked. Thanks Atul!

Atul Makwana

@Bienvenido Villabroza, yes you are correct, @sting is not working on the newer version. my above answer will perfectly in v8 or lower version

Abdelhameed Elnemr

what should i do if i want to show this tab only for the sales department

Avatar
Paramjitsingh Sahota (psa)
Best Answer

In form view, inside <notebook> tag you can add as many pages(TAB) by this syntax

 <notebook>
     <page string="Your Tab1">
         <field name="..."/>
     </page>  
     <page string="Your Tab2">
         <field name="..."/>
     </page>   
 </notebook>
5
Avatar
Descartar
Avatar
Indrabhan Bhamare
Best Answer

hello Math

Here for you I'm adding new tab in "Quotations" of "sale" module,this is similar to your requirement

Example.py

from openerp import fields, models, api, _

class class_name(models.Model):

    _inherit = 'sale.order'
    <fields name="..."/>

Example.xml

<record id="view_sale_order_tree" model="ir.ui.view">
<field name="name">view.sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">

<xpath expr="//page[@string='Other Information']" position="after">
<page string="My_New_Tab">
<field name='My_new_fields'/>
</page>
   </xpath>

</field>
</record>


5
Avatar
Descartar
Avatar
Ghanshyam Prajapati
Best Answer

inside <notebook> tag, after <page string="Personal Information"> </page> put your new tab, <page string="My Tab"> </page>

3
Avatar
Descartar
Avatar
Andreas Maertens
Best Answer

You need to add a new page in the notebook in the View. Are you creating an own Addon/Module to alter the partner page?

In case of you do please take a look on that: You need to inherit from the partner view in maybe partner_view.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <!--
    Partners Extension
  -->

    <record id="view_partner_property_form" model="ir.ui.view">
        <field name="name">res.partner.stock.property.form.inherit</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="product.view_partner_property_form"/>
        <field name="arch" type="xml">
            <notebook position="inside">
                <page string="My New Tab">
                    <field name="..."/>
                </page>
            </notebook>
        </field>
    </record>

  </data>
</openerp>
3
Avatar
Descartar
Maath
Autor

What I do without inherit view (inherit the module) <!-- ============== student================= --> <!-- 1st part of the sim_view start--> <record model="ir.ui.view" id="student_form"> <field name="name">Student</field> <field name="model">sim77.student</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="Student"> <field name="name"/> <field name="student_name"/>

<field name="gender"/> <field name="contract_id"/> </form> </field> </record> <!-- 1st part of the sim_view end--> can you help ? where I put code of new page?

Andreas Maertens

Then add a notebook to your view. That looks exactly as above code just without the "inherit_id" tag nor the position attribute in <notebook>. Notebook adds the Space for your Tabs to the form.

Andreas Maertens

You put the code of the new File in a separate .xml file. Then you need to add the .xml in your __openerp__.py under "update_xml". Just take a look to other addons therefor.

Andreas Maertens

Did that solved your Problem? If it does please mark one of the correct answers to help others to find the solution faster

Cyrus Waithaka

Great, this works fine for me. I have a one2many field in the partner model that creates a relationship with custom model. How can I add a "Create" button to the tab so that it pop up the view of the custom model?

Avatar
khudrath
Best Answer

How can we set one tab or page as default, i.e., when i open the screen that that tab opens by default

 

0
Avatar
Descartar
Pascal Tremblay

I would want to know too!

Rihene

Put it the first not the last hhhh ;)

Avatar
Abdullah
Best Answer

For adding a new tab your xpath had to be like this

<xpath expr="//page[2]" position='after'>
1,2,3 depending the number of your tab in the view.
0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
edit due date after creating partial purchase order
purchase purchase_order
Avatar
0
de maig 22
3391
Purchase prototype products; What´s your solution?
purchase purchase_order
Avatar
0
de jul. 24
2452
How to enable Source Document (field label) Origin (field name) Solved
purchase purchase_order
Avatar
Avatar
1
de nov. 20
5227
Configuring Purchase Order Form and Report Solved
purchase purchase_order
Avatar
Avatar
1
d’oct. 20
5736
Error: Field does not exists in odoo12
fields customization
Avatar
Avatar
1
de gen. 20
5465
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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