Files
tryton/trytond/ir/date.py
T
Cédric Krier e11a23deb2 Rationalize import path
We use absolute path when imported module is from a different context.
And we remove unnecessary __all__ definition.

issue9466
review323591002
2020-07-21 14:38:36 +02:00

26 lines
596 B
Python

# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import datetime
from trytond.model import Model
from trytond.rpc import RPC
class Date(Model):
'Date'
__name__ = 'ir.date'
@classmethod
def __setup__(cls):
super(Date, cls).__setup__()
cls.__rpc__.update({
'today': RPC(),
})
@staticmethod
def today(timezone=None):
'''
Return the current date
'''
return datetime.datetime.now(timezone).date()