Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
viewinherit
1 Responder
9417 Vistas
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
Descartar
Avatar
Koffi KPONOUGLO
Mejor respuesta

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
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to create another type of Invoice with other sequence?
view inherit
Avatar
0
mar 15
4851
Inherit a predefined view.
view inherit
Avatar
Avatar
1
mar 15
6453
v16: inherit view and add editable treeview in notebook
view inherit odoo16features
Avatar
1
nov 23
2110
Creating new view from a old view Resuelto
view res.partner inherit
Avatar
Avatar
11
ene 24
14403
Why the same domain for the same field doesn't work at both places?
domain view inherit
Avatar
Avatar
Avatar
Avatar
Avatar
7
ago 18
6988
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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