You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.4 KiB

10 years ago
10 years ago
10 years ago
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # This module copyright (C) 2014 Therp BV (<http://therp.nl>).
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. {
  22. "name": "pytz support for filter domains",
  23. "version": "1.0",
  24. "author": "Therp BV,Odoo Community Association (OCA)",
  25. "license": "AGPL-3",
  26. "complexity": "normal",
  27. "description": """
  28. Introduction
  29. ------------
  30. This module allows complex timezone operations in domains mimicing python's
  31. pytz. The heavy lifting is done by http://momentjs.com/timezone.
  32. It is meant to allow correct filters for 'Today', 'Yesterday' etc.
  33. In addition to implementing a subset of `pytz.tzinfo` and
  34. `datetime.astimezone`, there's a shortcut called `utc_today()` which returns
  35. the beginning of the day in the current user's time zone translated to UTC,
  36. this is equivalent to::
  37. pytz.timezone(tz).localize(datetime.datetime.now().replace(hour=0, minute=0,
  38. second=0)).astimezone(pytz.utc)
  39. in python.
  40. Usage
  41. -----
  42. Depend on this module and use filters like::
  43. [('write_date', '>=', utc_today().strftime('%Y-%m-%d %H:%M:%S'))]
  44. which displays records changed in the user's conception of today.""",
  45. "category": "Dependency",
  46. "depends": [
  47. 'web',
  48. ],
  49. "data": [
  50. ],
  51. "js": [
  52. 'static/src/js/web_pytz.js',
  53. 'static/lib/moment.min.js',
  54. 'static/lib/moment-timezone.min.js',
  55. ],
  56. "css": [
  57. ],
  58. "qweb": [
  59. ],
  60. "test": [
  61. 'static/test/web_pytz.js',
  62. ],
  63. "auto_install": False,
  64. "installable": True,
  65. "application": False,
  66. "external_dependencies": {
  67. 'python': [],
  68. },
  69. }