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

i create a object inherit from product.product,but the field not shows in the view

Suscribirse

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

Se marcó esta pregunta
viewinheritproduct.product
3 Respuestas
10510 Vistas
Avatar
figol New

what i want to do is add a column to product.product table so i create a new object inheriting from product.product , and i also create a new view inheriting from product.product_normal_form_view but the field i have added to product.product not showing in the form view. i can see the itemid field in product_product table. it is so strange , anyone can help me?? many thanks.

here is the code my_product.py

# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from datetime import datetime 

class ebayerp_product(osv.osv):
    _name = 'product.product'
    _inherit = "product.product"
    _columns = {
        'itemid' : fields.char('eBay ItemID', size=32, readonly=True, invisible=False),
        }
ebayerp_product()

my_product_view.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="product_normal_form_view" model="ir.ui.view">
            <field name="name">product.normal.form.inherit1</field>
            <field name="model">product.product</field>
            <field name="type">form</field>
            <field name="priority" eval="1"/>
            <field name="inherit_id" ref="product.product_normal_form_view"/>
            <field name="arch" type="xml">
                 <sheet position="inside">
                    <label for="ebayitemid"/>
                    <div name="ean">
                        <field name="itemid"/>
                    </div>
                 </sheet>
            </field>
       </record>
    </data>
</openerp>

product_normal_form_view form view (not all code, because not neccessary)

<record id="product_normal_form_view" model="ir.ui.view">
            <field name="name">product.normal.form</field>
            <field name="model">product.product</field>
            <field eval="7" name="priority"/>
            <field name="arch" type="xml">
                <form string="Product" version="7.0">
                    <sheet>
                        <field name="image_medium" widget="image" class="oe_avatar oe_left"/>
                        <div class="oe_title">
                            <div class="oe_edit_only">
                                <label for="name" string="Product Name"/>
                            </div>
                            <h1>
                                <field name="name"/>
                            </h1>
                            <label for="categ_id" class="oe_edit_only"/>
                            <h2><field name="categ_id"/></h2>
                            <div name="options" groups="base.group_user">
                                <field name="sale_ok"/>
                                <label for="sale_ok"/>
                            </div>
                        </div>
                        <div class="oe_right oe_button_box" name="buttons">
                        </div>
0
Avatar
Descartar
Maath

Hi , can you put all your codes so I can test and correct the error so the problem will solved quickly

figol New
Autor

ok , i will post the code soon.

figol New
Autor

the problem has been resolved . delete 'readonly=True' will be ok

Maath

Ok @figol New .... if there is no problem can you send me all codes

Avatar
ClueLogics Technologies Pvt. Ltd.
Mejor respuesta

Hi you define wrong field name in your view

 <field name="ebayitemid"/>

replace it with

 <field name="itemid"/>

and plz be remember you should use same whither same class name (product_product) or place a new field in class label _table=product_product other wise this field will not be added in the product table

Thanks Sandeep

7
Avatar
Descartar
figol New
Autor

I have changed ,but there is no luck

Avatar
Borni DHIFI
Mejor respuesta

Hi,

replace <field name="ebayitemid"/> to <field name="itemid"/> in form and view.

0
Avatar
Descartar
figol New
Autor

i have changed it , but there is no luck

Avatar
Serpent Consulting Services Pvt. Ltd.
Mejor respuesta

Hello,

your field is wrong

<field name="ebayitemid"/>

to replace it <field name="itemid"/>

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 inherit from view to add an element in it ?
view inherit
Avatar
Avatar
1
mar 15
9413
How to create another type of Invoice with other sequence?
view inherit
Avatar
0
mar 15
4843
Inherit a predefined view.
view inherit
Avatar
Avatar
1
mar 15
6451
v16: inherit view and add editable treeview in notebook
view inherit odoo16features
Avatar
1
nov 23
2105
Odoo 15 Inherit "product.product" get issue bad query: ALTER TABLE "product_product" ALTER COLUMN "base_unit_count" DROP NOT NULL Resuelto
inherit product.product v15
Avatar
1
mar 22
3795
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