pytz support for filter domains
web_pytz · OCA/web
-
Security25/25No findings
-
Activity0/25Last human commit 137 months ago
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 7.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Migrating to 19.0: only `__manifest__.py` is recognized: a module with `__openerp__.py` is not detected at all. migration-openerp-manifest · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Introduction
This module allows complex timezone operations in domains mimicing python's pytz. The heavy lifting is done by http://momentjs.com/timezone.
It is meant to allow correct filters for 'Today', 'Yesterday' etc.
In addition to implementing a subset of pytz.tzinfo and
datetime.astimezone, there's a shortcut called utc_today() which returns
the beginning of the day in the current user's time zone translated to UTC,
this is equivalent to::
pytz.timezone(tz).localize(datetime.datetime.now().replace(hour=0, minute=0, second=0)).astimezone(pytz.utc)
in python.
Usage
Depend on this module and use filters like::
[('write_date', '>=', utc_today().strftime('%Y-%m-%d %H:%M:%S'))]
which displays records changed in the user's conception of today.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 0
No views found for this module.
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 0
No models found for this module.