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
    • Conocimientos
    • 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

ver.14: how to customize login page

Suscribirse

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

Se marcó esta pregunta
customizeloginpagev14
2 Respuestas
23984 Vistas
Avatar
SmithJohn45

how i can customize login page and add a field contact_no (already inherited res.users and added contact_no), when user press [Log in] button, this will authenticate the user using contact_no first if exist otherwise use email.

please help.

screenshot for login page: ( here are only 2 fields email and password )


0
Avatar
Descartar
Avatar
Alaa
Mejor respuesta

You can use these apps (search apps in odoo apps by names provided below) to change the whole login page style.

Moreover, these apps provide the ability to define your own favicon and logo as you wish.

Apps Name:

Minimalist Login Form

Creative Login Form

Advanced Login Form


0
Avatar
Descartar
Avatar
Yurii Razumovskyi
Mejor respuesta

Hi.

In your case, I think, you could go the following way:

To change the method "_get_login_domain" from the file "odoo/addons/base/models/res_users.py":

    @api.model
    def _get_login_domain(self, login):
        return [('login', '=', login)]

This domain is used in the method "_login" in the same model to get a user by a login. If you inherit the method and change the domain adding your condition like ('contact_no', '=', login) you could get the necessary result. My solution was not tested and may be used as a possible case, so please test it before on your system.


P.S. If you will want to add your parameter to the login page you can do it in the following way:

    <template id="login" inherit_id="web.login" name="Custom Login" >
         <xpath expr="//div[hasclass('field-login')]" position="before">
<div class="form-group field-contact-no">
<label for="contact_no">Contact No</label>
<input type="text" placeholder="Contact No" name="contact_no" t-att-value="contact_no" id="contact_no" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autofocus="autofocus" autocapitalize="off"/>
</div>
</xpath>
    </template>

After that, you also need to add the logic for the "contact_no" parameter to the controller method "web_login" in the "web" module.

0
Avatar
Descartar
SmithJohn45
Autor

thanks for detailed guide & help, will check it and confirm.

SmithJohn45
Autor

first i implemented view part as you have created here, its looking fine Contact No is on top of Email.

to change the method _get_login_domain i failed to find the 'base' folder, may be in odoo 14 it changed. the file res_users.py exist in /addons/base_setup/ but it also inheritting ' res.users ' to modify. i searched for _get_ligin_domain within files, it present in /addons/website/models but it not looks like what you have posted here. please advise.

SmithJohn45
Autor

also checked /addons/web/controllers/main.py , web_login method is there but (as per my knowledge as beginner) i failed to figure it out, how to add the logic for the "contact_no" parameter? plesae help.

Yurii Razumovskyi

Hi.

The implementation of the logic that you need is quite complicated and will take time. If you are a beginner and it's your education task I propose to read the book "Odoo Development Essentials" https://www.packtpub.com/product/odoo-development-essentials/9781784392796 or "Odoo 14 Development Cookbook - Fourth Edition" https://www.packtpub.com/product/odoo-14-development-cookbook-fourth-edition/9781800200319.

If it's a business task you could hire our team to solve it by emailing support@garazd.biz.

Best Regards, Yurii Razumovskyi.

Company "Garazd Creation"

https://garazd.biz

SmithJohn45
Autor

thanks for books links. 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
"Remember Me" Login option in odoo
login loginpage v14
Avatar
0
mar 21
3729
Blank white page after login.
login page blank
Avatar
0
jun 16
10450
putting part of the report at the start of the last page odoo14 Resuelto
reporting page pages v14
Avatar
Avatar
Avatar
2
may 23
3410
How do I create a blank page so I can customize it only in CSS by myself?
style customize page odoo12
Avatar
0
feb 23
2961
How to call function when page loaded odoo-14
function page loaded v14
Avatar
Avatar
1
jul 22
6636
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