trytond-stock_lot_date/stock.py

24 lines
660 B
Python
Raw Normal View History

2014-11-07 14:45:24 +01:00
# This file is part stock_lot_date module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
2013-11-19 13:02:31 +01:00
from trytond.model import fields
from trytond.pool import Pool, PoolMeta
__all__ = ['Lot']
2018-10-19 07:44:41 +02:00
class Lot(metaclass=PoolMeta):
2013-11-19 13:02:31 +01:00
__name__ = 'stock.lot'
2015-02-19 11:29:36 +01:00
lot_date = fields.Date('Date Lot', required=True)
2013-11-19 13:02:31 +01:00
2013-11-20 08:50:32 +01:00
@classmethod
def __setup__(cls):
super(Lot, cls).__setup__()
2013-12-11 09:01:33 +01:00
cls._order.insert(0, ('lot_date', 'DESC'))
2013-11-20 08:50:32 +01:00
cls._order.insert(1, ('id', 'DESC'))
2013-11-19 13:02:31 +01:00
@staticmethod
def default_lot_date():
Date = Pool().get('ir.date')
return Date.today()