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

Datetime picker in website Odoo 12

Suscribirse

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

Se marcó esta pregunta
datetimeodooV12
1 Responder
9620 Vistas
Avatar
David Kovač

I am trying to create a datetime picker in a form using o_website_form_datetime, but the problem is that, the input field doesn't show the popup to enter the date and time.

 This is the code for my input:

<input id="date_time_funeral" type="text" name="date_time_funeral" class="form-control o_website_form_datetime" t-att-value="date_time_funeral" data-date-format="DD.MM.YYYY HH:MM" style="text-align: center;" autocomplete="off" required="true"/>


I took the code from an odoo 10 project, and there it works with no problem.

I am avoiding to use type="datetime-local", since it is not supported by all browsers.

1
Avatar
Descartar
Avatar
David Kovač
Autor Mejor respuesta

I've found out, there is a js and css file for the datetime picker both with the name tempusdominus, and i made some reasearch about it on the web, and i did a test.html file, in witch everything works fine, but in my odoo project it does not show the popup for the datetime picker. When the field is focus, it only inserts the current date and time without the popup, but if i manuly add jquery, bootrap and font-awsome it shows the popup and everything, but i get lots of errors in the console.


Here is what i add with xpath:

    <template inherit_id="website.assets_frontend" name="Website Form Assets Frontend" id="assets_frontend">
<xpath position="inside" expr=".">


            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"/>


<script type="text/javascript" src="/test_datetime/static/src/tempusdominus/moment-with-locales.min.js"/>
<script type="text/javascript" src="/test_datetime/static/src/tempusdominus/tempusdominus.js"/>
<link type="text/css" href="/test_datetime/static/src/tempusdominus/tempusdominus.css" rel="stylesheet"/>
</xpath>
</template>

this is now my input field:

<input id="date_time_funeral" type="text" name="date_time_funeral" class="form-control datetimepicker-input" data-toggle="datetimepicker" data-target="#date_time_funeral" style="text-align: center;" autocomplete="off"/>

<script type="text/javascript">
$(function () {
$('#date_time_funeral').datetimepicker();
});
</script>

here are the console errors:

Uncaught TypeError: Cannot read property '_options' of undefined

    at HTMLInputElement.<anonymous> (web.assets_common.js:3107)

    at HTMLDocument.dispatch (web.assets_common.js:892)

    at HTMLDocument.elemData.handle (web.assets_common.js:865)

    at Object.trigger (web.assets_common.js:886)

    at Object.simulate (web.assets_common.js:907)

    at HTMLDocument.handler (web.assets_common.js:924)

(anonymous) @ web.assets_common.js:3107

dispatch @ web.assets_common.js:892

elemData.handle @ web.assets_common.js:865

trigger @ web.assets_common.js:886

simulate @ web.assets_common.js:907

handler @ web.assets_common.js:924

web.assets_common.js:3456 error: Some modules could not be started

log @ web.assets_common.js:3456

(anonymous) @ web.assets_common.js:3469

e @ jquery.min.js:2

t @ jquery.min.js:2

setTimeout (async)

(anonymous) @ jquery.min.js:2

c @ jquery.min.js:2

add @ jquery.min.js:2

(anonymous) @ jquery.min.js:2

Deferred @ jquery.min.js:2

then @ jquery.min.js:2

(anonymous) @ web.assets_common.js:3469

(anonymous) @ web.assets_common.js:44

setTimeout (async)

_.delay @ web.assets_common.js:44

log_when_loaded @ web.assets_common.js:3469

fire @ web.assets_common.js:796

fireWith @ web.assets_common.js:801

ready @ web.assets_common.js:809

completed @ web.assets_common.js:810

web.assets_common.js:3457 Failed modules:           (3) ["payment.processing", "website.content.compatibility", "web_editor.widget"]

log @ web.assets_common.js:3457

(anonymous) @ web.assets_common.js:3469

e @ jquery.min.js:2

t @ jquery.min.js:2

setTimeout (async)

(anonymous) @ jquery.min.js:2

c @ jquery.min.js:2

add @ jquery.min.js:2

(anonymous) @ jquery.min.js:2

Deferred @ jquery.min.js:2

then @ jquery.min.js:2

(anonymous) @ web.assets_common.js:3469

(anonymous) @ web.assets_common.js:44

setTimeout (async)

_.delay @ web.assets_common.js:44

log_when_loaded @ web.assets_common.js:3469

fire @ web.assets_common.js:796

fireWith @ web.assets_common.js:801

ready @ web.assets_common.js:809

completed @ web.assets_common.js:810

web.assets_common.js:3458 Rejected modules:         (6) ["portal.portal", "sale_management.sale_management", "website_rating_project.rating", "account.AccountPortalSidebar.instance", "sale.SalePortalSidebar.instance", "root.widget"]

log @ web.assets_common.js:3458

(anonymous) @ web.assets_common.js:3469

e @ jquery.min.js:2

t @ jquery.min.js:2

setTimeout (async)

(anonymous) @ jquery.min.js:2

c @ jquery.min.js:2

add @ jquery.min.js:2

(anonymous) @ jquery.min.js:2

Deferred @ jquery.min.js:2

then @ jquery.min.js:2

(anonymous) @ web.assets_common.js:3469

(anonymous) @ web.assets_common.js:44

setTimeout (async)

_.delay @ web.assets_common.js:44

log_when_loaded @ web.assets_common.js:3469

fire @ web.assets_common.js:796

fireWith @ web.assets_common.js:801

ready @ web.assets_common.js:809

completed @ web.assets_common.js:810

web.assets_common.js:3459 Rejected linked modules:  (24) ["web_tour.tour", "website.tour_reset_password", "website_sale.tour_shop", "website_sale.tour_shop_cart_recovery", "website_sale.tour_shop_mail", "website_crm.tour", "portal.tour", "website.test.html_editor", "website_sale.tour", "website_sale.tour_shop_customize", "website_sale.tour_shop_custom_attribute_value", "website_sale.tour_shop_zoom", "website_sale.tour_shop_dynamic_variants", "website_sale.tour_shop_deleted_archived_variants", "website_sale.tour_shop_list_view_b2c", "website_sale.tour_shop_no_variant_attribute", "website_sale_comparison.tour_comparison", "website_sale_wishlist.tour", "web_editor.tour", "website.tour.banner", "website.tour.contact", "website.tour.customize", "website.tour.rte", "website_blog.tour"]

log @ web.assets_common.js:3459

(anonymous) @ web.assets_common.js:3469

e @ jquery.min.js:2

t @ jquery.min.js:2

setTimeout (async)

(anonymous) @ jquery.min.js:2

c @ jquery.min.js:2

add @ jquery.min.js:2

(anonymous) @ jquery.min.js:2

Deferred @ jquery.min.js:2

then @ jquery.min.js:2

(anonymous) @ web.assets_common.js:3469

(anonymous) @ web.assets_common.js:44

setTimeout (async)

_.delay @ web.assets_common.js:44

log_when_loaded @ web.assets_common.js:3469

fire @ web.assets_common.js:796

fireWith @ web.assets_common.js:801

ready @ web.assets_common.js:809

completed @ web.assets_common.js:810

web.assets_common.js:3460 Non loaded modules:       (18) ["web_editor.editor", "web_editor.rte.summernote", "web_editor.snippet.editor", "web_editor.snippets.options", "web_editor.translate", "web_unsplash.image_widgets", "point_of_sale.editor", "website.editor", "website.rte.summernote", "website.snippets.options", "website.contentMenu", "website.editMenu", "website.seo", "website.translateMenu", "website.theme", "website_sale.editor", "website_blog.editor", "website_blog.s_latest_posts_editor"]0: "web_editor.editor"1: "web_editor.rte.summernote"2: "web_editor.snippet.editor"3: "web_editor.snippets.options"4: "web_editor.translate"5: "web_unsplash.image_widgets"6: "point_of_sale.editor"7: "website.editor"8: "website.rte.summernote"9: "website.snippets.options"10: "website.contentMenu"11: "website.editMenu"12: "website.seo"13: "website.translateMenu"14: "website.theme"15: "website_sale.editor"16: "website_blog.editor"17: "website_blog.s_latest_posts_editor"length: 18__proto__: Array(0)

log @ web.assets_common.js:3460

(anonymous) @ web.assets_common.js:3469

e @ jquery.min.js:2

t @ jquery.min.js:2

setTimeout (async)

(anonymous) @ jquery.min.js:2

c @ jquery.min.js:2

add @ jquery.min.js:2

(anonymous) @ jquery.min.js:2

Deferred @ jquery.min.js:2

then @ jquery.min.js:2

(anonymous) @ web.assets_common.js:3469

(anonymous) @ web.assets_common.js:44

setTimeout (async)

_.delay @ web.assets_common.js:44

log_when_loaded @ web.assets_common.js:3469

fire @ web.assets_common.js:796

fireWith @ web.assets_common.js:801

ready @ web.assets_common.js:809

completed @ web.assets_common.js:810

1
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
Difference Between Two Dates (result not showing up when diff = 0 Day)
datetime
Avatar
Avatar
Avatar
3
jun 25
1958
Data Exceeded error while importing data in Odoo v12 Resuelto
odooV12
Avatar
Avatar
Avatar
Avatar
Avatar
4
may 24
8282
date time DB
datetime
Avatar
Avatar
1
jul 23
4760
Project and Timesheets
odooV12
Avatar
Avatar
1
jul 23
2902
Accepting Bancontact payments through Paypal
odooV12
Avatar
Avatar
Avatar
3
jun 23
3999
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.

Sitio web hecho con

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