Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

How to export date time as per my timezone in odoo 11?

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
employeeattendance
2 Antworten
8614 Ansichten
Avatar
Debasish

I tried to export datetime field of Attendance but i am getting wrong date time value. It is giving UTC date time instead my my timezone datetime.

How can i resolve this issue?  Please help me.

0
Avatar
Verwerfen
Waleed Ali Mohsen

There is no way to export the date in your timezone. You can change it in excel.

Avatar
Debasish
Autor Beste Antwort

I just update in main.py file of controller of Web module. You can do this in inherit the main.py file.

Import below package in main.py

from dateutil.parser import parse
import datetime
import pytz

-->Update in CSVExport class for CSV. Add below code in this class.

def check_date(self, value):
        try:
            parse_data = parse(value)
            return parse_data
        except Exception as e:
            return False

Update from_data() function like below code.

def from_data(self, fields, rows):
        fp = io.BytesIO()
        writer = pycompat.csv_writer(fp, quoting=1)
        writer.writerow(fields)
        for data in rows:
                row = []
                for d in data:
                        if isinstance(d, pycompat.string_types) and d.startswith(('=', '-', '+')):
                                d = "'" + d
                        if type(d) is str:
                                parse_data = self.check_date(d)
                                if parse_data:
                                        if len(d) > 10:
                                                tz = pytz.timezone(request._context.get('tz'))
                                                d = (pytz.utc.localize(datetime.datetime.strptime(d,'%Y-%m-%d %H:%M:%S')).astimezone(tz)).strftime('%Y-%m-%d %H:%M:%S')

                        row.append(pycompat.to_text(d))
                writer.writerow(row)
        return fp.getvalue()

-->For Excel Update below code in ExcelExportV class in datetime condition.

elif isinstance(cell_value, datetime.datetime):
        tz = pytz.timezone(request._context.get('tz'))
        cell_value = (pytz.utc.localize(cell_value).astimezone(tz)).strftime('%Y-%m-%d %H:%M:%S')
        cell_style = datetime_style

After that, restart your odoo service and check.

2
Avatar
Verwerfen
Rodrigo Robles

Hello, nice feedback, I will try for my reports; btw, I'm having a problem with UTC-0; some date fields are not getting our correct tz for interpretation in Odoo, like: a ticket in UI shows create_day as 31/07/2019 22:00:00 (UTC -4), but from server (i think its server), it's set at 01/08/2019 02:00:00 (UTC-0), in display while we group it for month it will be shown in August instead of July, that is making trouble for us in all ways, and we don't know if changing the server timezone (have tried but failed) would affect Odoo usage for 1 company or multicompany. You know a way to solve this?

Sorry for commenting on another issue, and forgive me for my english, im not native.

Thanks beforehand.

Rodrigo

Avatar
Ray Carnes (ray)
Beste Antwort

All datetime information is exported in the UTC timezone, no matter your local timezone. This is so all Users anywhere in the world can collaborate. If your Business Support team in San Jose, California extracts data and sends it to the New York City office to be updated who then sends it to the London office, the only way this works is with a common underlying timezone. By using UTC we prevent any data corruption due to a User importing data while in a different timezone than the User who exported it. 

0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Employee Attendance Resume Per Day
employee attendance
Avatar
0
Nov. 24
1641
should OpenERP use calender view in Attendance??
employee attendance
Avatar
0
März 15
4309
Attendance: sign in and sign out [Error ! Sign in (resp. Sign out) must follow Sign out (resp. Sign in)]
employee attendance
Avatar
Avatar
1
Sept. 25
7296
monitoring Employee Attendance with odoo cloud hosting (usb barcode) Gelöst
employee attendance barcode
Avatar
Avatar
Avatar
2
Juli 22
4363
[Odoo13] Generate QR Code for Badge Gelöst
employee attendance badge
Avatar
Avatar
3
Feb. 20
7636
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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