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 change field attributes via extending it

Suscribirse

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

Se marcó esta pregunta
fieldsattributesextend
5 Respuestas
45757 Vistas
Avatar
Tom

Hi Experts,

  Purpose: Intend to hide the "sale price" when a product is not marked as "can be sold" under the product "general information" tab.  

 Version: 10 CE

 Found this original field from product_views.xml: 

<field name="list_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>

 I wrote this:

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

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

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

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

                <group name="group_standard_price">

                   <field name="list_price" position="attributes">

                     <attrs name='invisible'>{[('sale_ok','=',False)]}</attrs>

                     <attrs name='widget'>{'monetary'}</attrs>

                    <attrs name='options'>{'currency_field': 'currency_id'}</attrs>

                 </field>

                </group>

            </field>

          </record>


It did not work, any idea? 

p/s: I always have this doubt, if I extend a field with the purpose to override one intended attribute only, I still need to include all other original attributes so they are all retained, right?

Thank you!

Tom

 

1
Avatar
Descartar
Fatih Piristine

use xpath to find the field you want to modify, then your code will work. you don't need to rewrite all attributes in your extension. only the ones you need to modify. otherwise you will mess with other things.

<xpath expr="//field[@name='list_price']" position="attributes">

<attribute name=" ... "> ... value here ... </attribute>

</xpath>

Avatar
Sunny Sheth
Mejor respuesta

Hello Tom,

try this.

<xpath expr="//field[@name='list_price']" position="attributes">
      <attribute name="attrs">{'invisible':[('sale_ok','=', False)]}</attribute>
</xpath>

or

<xpath expr="//field[@name='list_price']" position="attributes">
      <attribute name="attrs">{'invisible':[('sale_ok','!=', True)]}</attribute>
</xpath>
5
Avatar
Descartar
Avatar
zmirli
Mejor respuesta

Extending the schema refers to adding elements to the schema, usually object classes and attributes. The default schema comes with many object classes and attributes that are ready to be used for entries. Before you extend the schema, see if there are existing elements in the default schema that you might use instead of extending the schema. For example, if you need an additional attribute for the dominoPerson object class, evaluate if you can use an attribute already defined for dominoPerson.

https://www.dltutuapp.com/

https://www.9apps.ooo/

https://www.showbox.run/

0
Avatar
Descartar
Avatar
Smith Clarkson
Mejor respuesta

You can extend the schema by adding forms, subforms, and fields to the Domino Directory. This method allows Notes and Web users to create and view entries that use the new schema elements as documents, while also enabling LDAP user access to the entries. This method is more time consuming than using the Schema database, and must be done carefully to avoid mistakes in schema definition.

https://9appsapk.com https://vidmate.vin

0
Avatar
Descartar
Avatar
Lions Gate
Mejor respuesta

 You don't need to recreate all field attributes again with the new API:

from odoo import models, fields class SaleOrder(models.Model): _inherit = "sale.order" website_description = fields.Html(translate=False)

That should be enough.

I https://get-shareit.com

I https://get-vidmateapk.com

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
Inheriting attributes from Fields Resuelto
fields inheritance attributes
Avatar
Avatar
1
feb 23
8859
change_default attribute Resuelto
python fields attributes ORM
Avatar
Avatar
Avatar
2
oct 25
2076
How to make a field readonly and not editable after save. Resuelto
fields readonly attributes odoo9
Avatar
Avatar
Avatar
2
may 21
19881
_sequence predefined fields
fields _sequence predefined attributes
Avatar
Avatar
1
jul 15
7745
How to add fields and their values on all Product variants. (v8)
fields product.product variants attributes
Avatar
0
mar 15
6095
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