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 the contact company_type base field?

Suscribirse

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

Se marcó esta pregunta
fieldsContactsStudio
4 Respuestas
4576 Vistas
Avatar
Severin Caplazi

I want to add new selection but every time I tried to change this message pop up Properties of base fields cannot be altered in this manner! Please modify them through Python code, preferably through a custom add-on!' unfortunately i have no idea how to use Python.


best regards 


0
Avatar
Descartar
Severin Caplazi
Autor

Hello Nikhil Nakrani

How do i get acces to the odoo Xml? do i need full admin rights?

Thanks and Best Regards


Globalist Technology

Guys, as Ray Carnes already explained is really not recommended to chage this logic (note: is possible indeed, is just not recommended). 

If you do it you need to think that you may face several issue, not only to implementing it, but also at mantaining cause many other modules rely on this logic.

Personally I don't like the way it has been implemented, as extending this it's usually a common request. But it is what it is...

Avatar
Ray Carnes (ray)
Mejor respuesta

We don't recommend doing this.

1. This cannot be done without modifying the Odoo source code via your own module which inherits and overrides the Odoo module where this is defined. This is only something a developer can do.

2. This is a very fundamental part of Odoo and many other parts of the system rely on only having two options in this field. To implement another option would require a very advanced understanding of how the Odoo framework uses this field and a comprehensive search of the codebase to also modify every other place this field is referenced.

You should find another way to implement what you need - like using your own field or using tags.

1
Avatar
Descartar
Avatar
DM
Mejor respuesta

thanks but

  company_type = fields.Selection(string='Company Type',

         selection=[('person', 'Individual'), ('company', 'Company'),('external', 'Foreign')],

         compute='_compute_company_type', inverse='_write_company_type')

After adding the new value, if I select it it returns me to person

I think it's because of the method

_compute_company_type


Do you know how to prevent that from happening? I'm with odoo15

1
Avatar
Descartar
Avatar
Imad
Mejor respuesta

this is my workaround for this, I added  new a field is_organisme :

    company_type = fields.Selection(string='Company Type',
        selection=[('person', 'Individual'), ('company', 'Company'),('organisme', 'Organisme')],default='company',
        compute='_compute_company_type', inverse='_write_company_type')
    is_organisme = fields.Boolean(string='Organisme', default=False,
        help="Check if the contact is an Organism, otherwise it is a company or a persone")

    @api.depends('is_company')

    def _compute_company_type(self):

        for partner in self:

            if partner.is_organisme and not partner.is_company:

                partner.company_type = 'organisme'

            elif partner.is_company and not partner.is_organisme:

                partner.company_type = 'company'

            else:

                partner.company_type = 'person'

    def _write_company_type(self):

        for partner in self:

            if self.company_type == 'company':

                self.is_company = True

                self.is_organisme = False

            if self.company_type == 'person':

                self.is_company = False

                self.is_organisme = False

            if self.company_type == 'organisme':

                self.is_company = False

                self.is_organisme = True

    @api.onchange('company_type')

    def onchange_company_type(self):

  if self.company_type == 'company':

            self.is_company = True

            self.is_organisme = False

        if self.company_type == 'person':

            self.is_company = False

            self.is_organisme = False

        if self.company_type == 'organisme':

            self.is_company = False

            self.is_organisme = True

      

0
Avatar
Descartar
Avatar
Nikhil Nakrani
Mejor respuesta

Hi Severin Caplazi,

  1. First in your odoo addons find this field.

   2. create your custom_module in odoo and inside model.

   3. inherit res.partner model like this way,

  4. Then add below you modify field like this way.

here i add one (key, value) new as (test, Testing) you can add multiple here.

 5. Add this file in your init.py 

Thanks.

0
Avatar
Descartar
Severin Caplazi
Autor

Hello Nikhil Nakrani

How do i get acces to the odoo Xml? do i need full admin rights?

Thanks and Best Regards

¿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
Migrating Odoo Studio fields to a custom module Resuelto
fields Studio
Avatar
Avatar
1
sept 25
968
Studio: Add related field that does not update after initial record creation Resuelto
fields Studio
Avatar
Avatar
2
oct 23
4789
Increasing Field Odoo Studio
fields Studio
Avatar
0
jun 22
23
Simple Computed Field help Resuelto
fields compute Studio
Avatar
Avatar
Avatar
3
sept 24
2092
Change quantity in order lines based on modification another value
fields Studio Automation
Avatar
0
nov 23
2036
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