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
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • 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

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
4609 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.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Migrating Odoo Studio fields to a custom module Resuelto
fields Studio
Avatar
Avatar
1
sept 25
997
Studio: Add related field that does not update after initial record creation Resuelto
fields Studio
Avatar
Avatar
2
oct 23
4828
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
2117
Change quantity in order lines based on modification another value
fields Studio Automation
Avatar
0
nov 23
2071
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