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
    Real Estate
    • Real Estate Agency
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consulting
    • Accounting Firm
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Furnitures
    • Food
    • 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
    • Solar Energy Systems
    • Shoe Maker
    • Serveis de neteja
    • HVAC Services
    Others
    • 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

Custom Views clicking menuitem

Subscriure's

Get notified when there's activity on this post

This question has been flagged
treeviewview
2 Respostes
9198 Vistes
Avatar
Victor

Hello, I customized my sale.order adding some fields by a custom module. I need to create a new menu item which it shows the typical tree list with only this fields that I added, but I need also the form view with this new fields when I click in the row that I want to modify.

I did this xml:

<openerp>
    <data>
        <record id="view_commission_commercial_liquidacion_tree" model="ir.ui.view">
            <field name="name">commission.commercial.liquidacion.tree</field>
            <field name="model">sale.order</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                    <tree string="Comisiones">
                        <field name="importe_total" select="1"  />
                        <field name="importe1" select="1"  />
                        <field name="fecha1" select="1"  />
                        <field name="estado1" select="1"  />
                        <field name="importe2" select="1"  />
                        <field name="fecha2" select="1"  />
                        <field name="estado2" select="1"  />
                        <field name="importe_ajuste" select="1"  />
                        <field name="fecha_ajuste" select="1"  />
                        <field name="estado_ajuste" select="1"  />
                    </tree>
            </field>
        </record>
        <record id="view_commission_commercial_liquidacion_form" model="ir.ui.view">
            <field name="name">commission.commercial.liquidacion.form</field>
            <field name="model">sale.order</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Liquidación">
                    <field name="importe_total" select="1"/>
                    <field name="importe1" select="1"/>
                    <field name="fecha1" select="1"/>
                    <field name="estado1" select="1"/>
                    <field name="importe2" select="1"/>
                    <field name="fecha2" select="1"/>
                    <field name="estado2" select="1"/>
                    <field name="importe_ajuste" select="1"/>
                    <field name="fecha_ajuste" select="1"/>
                    <field name="estado_ajuste" select="1"/>
                    <field name="commercial_id" select="1"/>
                </form>
            </field>
        </record>
        <record model="ir.actions.act_window" id="open_view_commission_commercial_liquidacion_tree">
            <field name="name">Liquidaciones</field>
            <field name="res_model">sale.order</field>
            <field name="view_type">tree</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_commission_commercial_liquidacion_tree"/>
        </record>
        <menuitem name="Comisiones" parent="base.menu_base_partner" id="menu_commission_commercial_liquidacion_open_view"/>
        <menuitem name="Liquidación" parent="menu_commission_commercial_liquidacion_open_view" id="menu_commission_commercial_liquidacion_open_view_list" action="open_view_commission_commercial_liquidacion_tree"/>
    </data>
</openerp>

With this xml, it appears my custom list but without search box, and I need it, and when you click on form view (not clicking on the row, but on the form icon), it appears the original view of sale.order. I don't know how link my custom form view.

Somebody could help me, please?

Thank you in advance.

0
Avatar
Descartar
Avatar
Subhin P V
Best Answer

When you have to add Some Fields to an existing model you need to Inherit the model both in Python file and its xml file. In The Xml file you need to inherit the original Sale order form view and Then add your custom Fields for making them visible In the View.

THIS is how you inherit the sale order view. Use this code for your form view and Your Fields will Appear.

    <record id="view_commission_commercial_liquidacion_form" model="ir.ui.view">
        <field name="name">commission.commercial.liquidacion.form</field>
        <field name="model">sale.order</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
          <field name="create_date" position="after">
                <field name="importe_total" select="1"/>
                <field name="importe1" select="1"/>
                <field name="fecha1" select="1"/>
                <field name="estado1" select="1"/>
                <field name="importe2" select="1"/>
                <field name="fecha2" select="1"/>
                <field name="estado2" select="1"/>
                <field name="importe_ajuste" select="1"/>
                <field name="fecha_ajuste" select="1"/>
                <field name="estado_ajuste" select="1"/>
                <field name="commercial_id" select="1"/>
        </field>
    </record>

Here the line <field name="inherit_id" ref="sale.view_order_form"/> inherits the original sale.order form record where "sale" is the module name and form record name is "view_order_form" .

0
Avatar
Descartar
Avatar
Victor
Autor Best Answer

Hello Subbin, thank you for you answer. I already use your exemple when I customized the sale.order view, but now, I'm trying to devel a new menu item with a new custom form and tree view. Here I put: <field name="view_mode">tree,form</field> <field name="view_id" ref="view_commission_commercial_liquidacion_tree"/> And when I click to the menu item it access to my tree view but when you click un form, it access to original form and I want to access to my form view: view_commission_commercial_liquidacion_form But I don't know how do it...

0
Avatar
Descartar
Victor
Autor

I found the solution here: http://forum.openerp.com/forum/topic14068.html

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
Why is my Custom TreeView showing only one record, instead of a list of records? Solved
treeview view
Avatar
Avatar
2
de maig 18
4891
one2many issue with view
treeview view one2many
Avatar
Avatar
1
de març 15
5219
How to Align Left [float, integer] Fields in Tree View in Odoo
treeview
Avatar
Avatar
Avatar
Avatar
3
d’abr. 25
5894
Odoo10: how to set the tree (list) view as default view for Customers and Products in Sales module Solved
view
Avatar
Avatar
Avatar
Avatar
4
de gen. 24
24328
Attrs attribute Solved
view
Avatar
Avatar
2
de gen. 24
3170
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