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
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. web
  3. Web Timezone Switcher v 18.0
  4. Sales Conditions FAQ

Web Timezone Switcher

by Apexive Solutions LLC https://github.com/smartops-aero/smartops-odoo-flight
Odoo
v 18.0 Third Party 2
Download for v 18.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 565
Technical Name web_tz_switcher
LicenseLGPL-3
Websitehttps://github.com/smartops-aero/smartops-odoo-flight
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 565
Technical Name web_tz_switcher
LicenseLGPL-3
Websitehttps://github.com/smartops-aero/smartops-odoo-flight
  • Description
  • Documentation

Web Timezone Switcher

Real-time timezone switching for Odoo display without database modifications. Switch between timezones instantly — all datetime fields update automatically.

Session-Based No DB Changes Auto Re-render Persistent

What Is It?

This module adds a systray dropdown that allows users to switch their display timezone in real-time without modifying any database records. All datetime fields automatically re-render in the selected timezone. Perfect for aviation operations, global teams, and multi-timezone business operations.

See It In Action

Timezone Switcher Dropdown

Systray dropdown with live clock, search, and one-click reset.

Key Features

Session-Based Switching

No database modifications. Timezone preference is stored in session context only, keeping your user records clean.

Auto Re-rendering

All datetime fields update immediately when you switch timezone. No manual refresh needed.

Persistent Preference

Your timezone choice survives page reloads via localStorage. Resets after logout for security.

Full IANA Support

Complete pytz timezone database with 400+ timezones. Search by city, country, or region.

Smart Search

Quick timezone lookup with search-as-you-type. Timezones organized by region for easy browsing.

Live Clock Display

Shows current time in selected timezone with live updates. Override indicator when using non-default timezone.

Use Cases

Aviation Operations

View flight times in departure, arrival, or UTC timezone. Perfect for dispatchers and operations teams working across time zones.

Global Support Teams

Switch to customer's timezone to understand when issues occurred. Better communication and faster resolution.

Multi-Region Business

View reports in regional timezones: APAC, EMEA, Americas. Make sense of data in local context.

How It Works

  1. Click the timezone dropdown in the systray (top-right corner)
  2. Search or browse available timezones by region
  3. Select a timezone — all datetime fields re-render immediately
  4. Reset to default — click "Reset to Default" when in override mode

Technical Highlights

No Database Modifications

All times in the database remain in UTC. Only the display is affected. User records are never modified.

Developer Friendly

Provides a timezone_switcher service for programmatic access. Easy integration with custom components.

Ready to Go Global?

Install now and switch timezones instantly. No configuration needed!

All database times remain in UTC

Author: Apexive Solutions LLC

License: LGPL-3

Support: support@apexive.com

Web Timezone Switcher

Real-time timezone switching for Odoo display without database modifications.

Overview

This module adds a systray dropdown that allows users to switch their display timezone in real-time without modifying any database records. All datetime fields automatically re-render in the selected timezone.

Key Features

  • Session-based switching - No database modifications
  • Systray integration - Easy access from any page
  • Auto re-rendering - Datetime fields update immediately
  • Persistent preference - Survives page reloads via localStorage
  • User default fallback - Gracefully falls back to user's configured timezone
  • IANA timezone support - Full pytz timezone database
  • Search functionality - Quick timezone lookup
  • UTC offset display - Shows offset for each timezone
  • Current time display - Live clock in selected timezone
  • Override indicator - Badge shows when using non-default timezone

Installation

  1. Copy the web_tz_switcher module to your addons directory
  2. Update the module list: Settings → Technical → Database Structure → Update Apps List
  3. Install the module: Apps → Search "Web Timezone Switcher" → Install

No configuration needed - works immediately after installation!

Usage

Basic Usage

  1. Click the timezone dropdown in the systray (top-right corner)
  2. Search or browse available timezones by region
  3. Select a timezone - All datetime fields re-render immediately
  4. Reset to default - Click "Reset to Default" button when in override mode

Features

Live Time Display

The systray shows:

  • Current timezone abbreviation (e.g., "New York (14:30)")
  • Live clock updating every second
  • Warning badge when using override timezone

Smart Timezone Selection

The dropdown provides:

  • Search box - Type to filter timezones (e.g., "york", "tokyo")
  • Regional grouping - Timezones organized by continent
  • UTC offsets - Each timezone shows its current UTC offset
  • Current indicator - Checkmark shows active timezone
  • Show All Regions - Toggle to see all available regions

Session Persistence

Your timezone preference:

  • Persists across page navigation
  • Survives browser refresh (localStorage)
  • Resets after logout
  • Independent per browser/device

Technical Details

Architecture

┌─────────────────────────────────────────────────┐
│  Frontend (Browser)                             │
│  ┌───────────────────────────────────────────┐  │
│  │  Systray Component                        │  │
│  │  - Timezone dropdown UI                   │  │
│  │  - Search & selection                     │  │
│  └───────────────────────────────────────────┘  │
│  ┌───────────────────────────────────────────┐  │
│  │  Timezone Service                         │  │
│  │  - RPC calls to backend                   │  │
│  │  - User context updates                   │  │
│  │  - View re-rendering                      │  │
│  │  - localStorage persistence               │  │
│  └───────────────────────────────────────────┘  │
└─────────────────────────────────────────────────┘
                    │ JSON-RPC
                    ▼
┌─────────────────────────────────────────────────┐
│  Backend (Odoo Server)                          │
│  ┌───────────────────────────────────────────┐  │
│  │  Controller                               │  │
│  │  /web/timezone/switch                     │  │
│  │  /web/timezone/reset                      │  │
│  │  /web/timezone/current                    │  │
│  │  /web/timezone/list                       │  │
│  └───────────────────────────────────────────┘  │
│  ┌───────────────────────────────────────────┐  │
│  │  Session Context                          │  │
│  │  request.session.context['tz'] = 'UTC+5' │  │
│  └───────────────────────────────────────────┘  │
└─────────────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────────────┐
│  Database (PostgreSQL)                          │
│  - All datetime fields remain in UTC           │
│  - No user records modified                     │
│  - No timezone data stored                      │
└─────────────────────────────────────────────────┘

How It Works

  1. User selects timezone in systray dropdown
  2. Service calls backend via /web/timezone/switch
  3. Backend validates timezone against pytz database
  4. Session context updated with tz parameter
  5. User context patched via user.updateContext({ tz })
  6. Current view reloads triggering datetime re-rendering
  7. Preference stored in browser localStorage
  8. All datetime fields now display in selected timezone

Key Design Principles

No Database Modifications

# NEVER does this:
user.write({'tz': 'America/New_York'})

# ONLY does this:
request.session.context['tz'] = 'America/New_York'

Session-Based Storage

// Frontend updates user context (affects rendering only)
user.updateContext({ tz: timezone });

// Backend updates session context
request.session.context = { ...context, tz: timezone };

Graceful Fallback

Selected Timezone (session context)
    ↓ (if not set)
User's Default Timezone (res.users.tz)
    ↓ (if not set)
UTC

API Reference

Backend Endpoints

POST /web/timezone/switch

Switch to a new timezone.

Request:

{
  "timezone": "America/New_York"
}

Response:

{
  "success": true,
  "timezone": "America/New_York",
  "user_context": {
    "tz": "America/New_York"
  }
}

POST /web/timezone/reset

Reset to user's default timezone.

Response:

{
  "success": true,
  "timezone": "UTC",
  "user_context": {}
}

POST /web/timezone/current

Get current timezone information.

Response:

{
  "timezone": "America/New_York",
  "is_override": true,
  "user_default": "UTC",
  "session_context": {}
}

POST /web/timezone/list

Get available timezones.

Request:

{
  "common_only": true
}

Response:

{
  "timezones": ["America/New_York", "Europe/London"],
  "grouped": {
    "America": ["America/New_York"],
    "Europe": ["Europe/London"]
  },
  "count": 400
}

Frontend Service

import { useService } from "@web/core/utils/hooks";

const timezoneSwitcher = useService("timezone_switcher");

// Get current timezone
const tz = await timezoneSwitcher.getCurrentTimezone();

// Switch timezone
await timezoneSwitcher.switchTimezone("Europe/Paris");

// Reset to default
await timezoneSwitcher.resetTimezone();

// List timezones
const { timezones, grouped } = await timezoneSwitcher.listTimezones(true);

Use Cases

Aviation Operations

Perfect for flight operations spanning multiple timezones:

User in London (GMT) viewing:
- Flight departure: Los Angeles 10:00 PST
- Flight arrival: New York 18:00 EST

Switch to PST:
- Departure: 10:00 PST ✓
- Arrival: 15:00 PST

Switch to EST:
- Departure: 13:00 EST
- Arrival: 18:00 EST ✓

Global Support Teams

Support staff can switch to customer's timezone:

Support Agent in India (IST):
Customer ticket timestamp: 2024-12-03 09:00 PST

Switch to PST:
Ticket created: 09:00 PST (customer's local time)

Multi-Region Business

View reports in different regional timezones:

Sales Manager reviewing regional reports:
- APAC sales: Switch to Asia/Tokyo
- EMEA sales: Switch to Europe/London
- Americas sales: Switch to America/New_York

Compatibility

  • Odoo Version: 18.0
  • Python: 3.10+
  • Dependencies: web (core Odoo module)
  • Browser: Modern browsers with localStorage support

Testing

Run the included test suite:

# Run all tests
odoo-bin -c odoo.conf --test-enable --stop-after-init \
  --test-tags=web_tz_switcher -d test_db -u web_tz_switcher

# Run specific test
odoo-bin -c odoo.conf --test-enable --stop-after-init \
  --test-tags=web_tz_switcher.test_timezone_controller -d test_db

Test coverage:

  • Valid timezone switching
  • Invalid timezone handling
  • Reset to default
  • Session persistence
  • Override flag behavior
  • Timezone listing (common & all)

Troubleshooting

Timezone not persisting after refresh

Cause: localStorage disabled or browser in private mode

Solution: Enable localStorage or accept that timezone resets each session

Datetime fields not updating

Cause: Custom datetime widgets not using Odoo's standard context

Solution: Ensure custom widgets read user.context.tz

Timezone dropdown not appearing

Cause: Asset bundle not loaded

Solution: Clear browser cache and reload: Ctrl+Shift+R

Performance issues with many datetime fields

Cause: Full page reload on timezone switch

Solution: Consider selective re-rendering (advanced customization)

License

LGPL-3.0

Author

Apexive Solutions LLC

Website: https://apexive.com

Support

For issues, questions, or contributions:

  • Email: support@apexive.com

Credits

Built with:

  • Odoo OWL framework
  • Luxon datetime library
  • Python pytz library
  • Bootstrap styling

Remember: This module only changes display. All database times remain in UTC!

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
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

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