Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Food & Hospitality
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Guest House
    • Distribuidor de bebidas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consulting
    • Accounting Firm
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Trades
    • Handyman
    • Hardware y asistencia informática
    • Solar Energy Systems
    • Zapatero
    • Servicios de limpieza
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

Using a Module to Customize Product Tree View

Suscribirse

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

Se marcó esta pregunta
viewsmodulesxmlinheritance
5 Respuestas
14102 Vistas
Avatar
Jayson Wu

Hi,

I'm trying to add another column on the Product Tree View by using a module.

However, I'm receiving this error message: except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

This is what I got so far,

__openerp__.py => I already added 'product' on the 'depends' field.

mymodule.py =>

class custom_products(osv.osv):
    _name = "product.product"
    _inherit = "product.product"
    _columns = {
        'asupplier_code': fields.char('Supplier Code',size=32),
    }
    _defaults = {
        'asupplier_code': '-',
    }
custom_products();

mymodule_view.xml =>

<record model="ir.ui.view" id="attempt_2_form">
    <field name="name">product.product.tree</field>
    <field name="model">product.product</field>
    <field name="type">tree</field>
    <field name="inherit_id" ref="product.product_product_tree_view"/>
    <field name="arch" type="xml">
        <field name="default_code" position="after">
            <field name="assupplier_code"/>
        </field>
    </field>
</record>

From what I understand, (when trying to create a module that will edit an existing view)

<field name="name">product.product.tree</field> : I got the value from the View Name field

<field name="model">product.product</field> : I got it from the Object field

<field name="inherit_id" ref="product.product_product_tree_view"/> : The ref would be the name of the view that I wish to inherit right?

Is there something wrong with my understanding and code that results with a Invalid XML for View Architecture?

Thanks!

0
Avatar
Descartar
Jayson Wu
Autor

I finally found what's wrong. The field name has an extra 's'.

Jayson Wu
Autor

still not fixed though.

Avatar
Alfa y Omega Pachuca
Mejor respuesta

In odoo 9 (in you have you odoo server in other directory, just change the path to you odoo directory installation)

Create a new custom module:

cd /odoo/odoo-server <--Here inside is the odoo.py script to create a new custom module.

sudo ./odoo.py scaffold myproductviewtreelist /odoo/custom/addons <--This is my directory for my custom modules, this code create a new custom module

cd /odoo/custom/addons/myproductviewtreelist

Edit  __openerp__.py and save this settings:

locate: 'depends': ['base'], and add 'sale' like this:

'depends': ['base','sale'],

Edit emplates.xml and save this settings:

add this code: <--In my case a just want add the default_code field but you can add any field from your product form.

<record id="my_view_products_tree_inherit" model="ir.ui.view">

<field name="name">my.view.products.tree.inherit</field>

<field name="model">product.template</field>

<field name="inherit_id" ref="product.product_template_tree_view"/>

<field name="arch" type="xml">

<!-- Before the field 'name' i add the 'default_code' field, or any field from my product form-->

<field name="name" position="before">

<field name="default_code"/>

</field>

</field>

</record>

Go to top menu/apps on line then go to left menu update apps list, delete the filter in the search box app and put my and search, then install the module myproductviewtreelist

0
Avatar
Descartar
Avatar
René Schuster
Mejor respuesta

In your __openerp__.py file you should add your custom view:

'data': [
'yourmodule_view.xml'
]

Regards.

0
Avatar
Descartar
Avatar
Bole
Mejor respuesta

In your module you have declared new class custom_products...

and in view you are calling odl class product.product...

rename your module class to :

class product_product (osv.osv):
..... 

 

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
OpenERP v7.0 inherit view to add field
modules xml inheritance
Avatar
Avatar
Avatar
3
mar 15
6998
Inherited form view for specific module without overriding base view - Odoo 15.0
views modules xml form
Avatar
Avatar
1
mar 22
4057
Replace xpath expr with xpath
views xml inheritance xpath
Avatar
0
ago 21
4156
models in records?
views modules xml odoo
Avatar
Avatar
1
may 16
4644
How do I access sub-components of a list field? Resuelto
views xml inheritance extend
Avatar
Avatar
Avatar
2
mar 15
7692
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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