Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Datetime picker in website Odoo 12

Subscribe

Get notified when there's activity on this post

This question has been flagged
datetimeodooV12
1 Reply
9618 Views
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
Discard
Avatar
David Kovač
Author Best Answer

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
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Difference Between Two Dates (result not showing up when diff = 0 Day)
datetime
Avatar
Avatar
Avatar
3
Jun 25
1954
Data Exceeded error while importing data in Odoo v12 Solved
odooV12
Avatar
Avatar
Avatar
Avatar
Avatar
4
May 24
8282
date time DB
datetime
Avatar
Avatar
1
Jul 23
4756
Project and Timesheets
odooV12
Avatar
Avatar
1
Jul 23
2902
Accepting Bancontact payments through Paypal
odooV12
Avatar
Avatar
Avatar
3
Jun 23
3999
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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